API

Class BoneLookController

Class used to make a bone look toward a point in space

Index
  • Create a BoneLookController

    Parameters

    • mesh: TransformNode

      the TransformNode that the bone belongs to

    • bone: Bone

      the bone that will be looking to the target

    • target: Vector3

      the target Vector3 to look at

    • Optionaloptions: {
          adjustPitch?: number;
          adjustRoll?: number;
          adjustYaw?: number;
          maxPitch?: number;
          maxYaw?: number;
          minPitch?: number;
          minYaw?: number;
          pitchAxis?: Vector3;
          slerpAmount?: number;
          upAxis?: Vector3;
          upAxisSpace?: Space;
          useAbsoluteValueForYaw?: boolean;
          yawAxis?: Vector3;
      }

      optional settings:

      • maxYaw: the maximum angle the bone will yaw to
      • minYaw: the minimum angle the bone will yaw to
      • maxPitch: the maximum angle the bone will pitch to
      • minPitch: the minimum angle the bone will yaw to
      • slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
      • upAxis: the up axis of the coordinate system
      • upAxisSpace: the space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD.
      • yawAxis: set yawAxis if the bone does not yaw on the y axis
      • pitchAxis: set pitchAxis if the bone does not pitch on the x axis
      • adjustYaw: used to make an adjustment to the yaw of the bone
      • adjustPitch: used to make an adjustment to the pitch of the bone
      • adjustRoll: used to make an adjustment to the roll of the bone

    Returns BoneLookController

adjustPitch: number = 0

Used to make an adjustment to the pitch of the bone

adjustRoll: number = 0

Used to make an adjustment to the roll of the bone

adjustYaw: number = 0

Used to make an adjustment to the yaw of the bone

bone: Bone

The bone that will be looking to the target

The TransformNode that the bone is attached to Name kept as mesh for back compatibility

slerpAmount: number = 1

The amount to slerp (spherical linear interpolation) to the target. Set this to a value between 0 and 1 (a value of 1 disables slerp)

target: Vector3

The target Vector3 that the bone will look at

upAxis: Vector3 = ...

The up axis of the coordinate system that is used when the bone is rotated

upAxisSpace: Space = Space.LOCAL

The space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD

useAbsoluteValueForYaw: boolean = false

Use the absolute value for yaw when checking the min/max constraints