Options
All
  • Public
  • Public/Protected
  • All
Menu

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

see

https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons#bonelookcontroller

Hierarchy

  • BoneLookController

Index

Constructors

  • new BoneLookController(mesh: TransformNode, bone: Bone, target: Vector3, options?: { 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 }): BoneLookController
  • 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

    • Optional options: { 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
      • Optional adjustPitch?: number
      • Optional adjustRoll?: number
      • Optional adjustYaw?: number
      • Optional maxPitch?: number
      • Optional maxYaw?: number
      • Optional minPitch?: number
      • Optional minYaw?: number
      • Optional pitchAxis?: Vector3
      • Optional slerpAmount?: number
      • Optional upAxis?: Vector3
      • Optional upAxisSpace?: Space
      • Optional useAbsoluteValueForYaw?: boolean
      • Optional yawAxis?: Vector3

    Returns BoneLookController

Properties

adjustPitch: number

Used to make an adjustment to the pitch of the bone

adjustRoll: number

Used to make an adjustment to the roll of the bone

adjustYaw: number

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

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

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

useAbsoluteValueForYaw: boolean

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

Accessors

  • get maxPitch(): number
  • set maxPitch(value: number): void
  • Gets or sets the maximum pitch angle that the bone can look to

    Returns number

  • Gets or sets the maximum pitch angle that the bone can look to

    Parameters

    • value: number

    Returns void

  • get maxYaw(): number
  • set maxYaw(value: number): void
  • Gets or sets the maximum yaw angle that the bone can look to

    Returns number

  • Gets or sets the maximum yaw angle that the bone can look to

    Parameters

    • value: number

    Returns void

  • get minPitch(): number
  • set minPitch(value: number): void
  • Gets or sets the minimum pitch angle that the bone can look to

    Returns number

  • Gets or sets the minimum pitch angle that the bone can look to

    Parameters

    • value: number

    Returns void

  • get minYaw(): number
  • set minYaw(value: number): void
  • Gets or sets the minimum yaw angle that the bone can look to

    Returns number

  • Gets or sets the minimum yaw angle that the bone can look to

    Parameters

    • value: number

    Returns void

Methods

  • update(): void
  • Update the bone to look at the target. This should be called before the scene is rendered (use scene.registerBeforeRender())

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme