Class ControllerPart

Represents a Controller.

Hierarchy

  • Child

    Hierarchy

    • ControllerPart

Constructors

Properties

fileChild: FileChild
fileShape: FileShape

Accessors

  • get color(): string
  • The color of this shape.

    Returns string

  • set color(value: string): void
  • Parameters

    • value: string

    Returns void

  • get shapeId(): string
  • The shapeId of this shape. Determines the model and behavior in-game.

    Returns string

  • set shapeId(value: string): void
  • Parameters

    • value: string

    Returns void

  • get timePerFrame(): number
  • The time per frame of the controller.

    Returns number

  • set timePerFrame(value: number): void
  • Parameters

    • value: number

    Returns void

Methods

  • Connects this child to another child. Both children must be interactable.

    Parameters

    • other: number | Child

      The Child object or the ID of the child to connect to.

    Returns void

  • Disconnects this child from another child.

    Parameters

    • other: number | Child

      The Child object or the ID of the child to disconnect from.

    Returns void

  • Gets a list of the IDs of all joints this controller is connected to.

    Returns

    The list of joint IDs.

    Returns number[]

  • Retrieves the sequence for a given joint if it exists.

    Returns

    The sequence of the joint, or undefined if it does not exist.

    Parameters

    Returns undefined | { frames: number[]; reversed: boolean }

  • Adds or updates a sequence for a joint in the controller.

    Parameters

    • index: number

      The index of the sequence. Controls where in the UI the sequence is.

    • joint: PistonJoint | BearingJoint

      The piston or bearing to add or update.

    • sequence: number[]

      The sequence of frames to add or update. The first element is the starting frame, when the controller is off. Missing values are filled in. Any items in the array past index 10 are ignored.

    • reversed: boolean = false

      Whether positive angles will spin the bearing counter-clockwise (looking from the front). Only applies when this sequence is for a bearing. Defaults to false.

    Returns void

  • Attempts to convert a Child to ControllerPart. Only returns if the Child's file object is a ControllerPart.

    Returns

    The converted ControllerPart, or undefined if the Child was not a ControllerPart.

    Parameters

    • potential: Child

      The Child to convert.

    Returns undefined | ControllerPart

  • Creates a controller.

    Returns

    The created controller.

    Parameters

    • position: Vector3

      The position of the controller.

    • rotation: Axis

      The rotation of the controller.

    • Optional color: string

      The color of the controller. Fallbacks to the controller's default color.

    • looped: boolean = false

      Whether the controller is looped. Defaults to false.

    • timePerFrame: number = 1

      The time per frame of the controller. Defaults to 1.

    Returns ControllerPart

Generated using TypeDoc