Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BoneLookController

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

see

https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#bonelookcontroller

Hierarchy

  • BoneLookController

Index

Constructors

constructor

  • 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; 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; 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 yawAxis?: Vector3

    Returns BoneLookController

Properties

adjustPitchSearch playground for adjustPitch

adjustPitch: number

Used to make an adjustment to the pitch of the bone

adjustRollSearch playground for adjustRoll

adjustRoll: number

Used to make an adjustment to the roll of the bone

adjustYawSearch playground for adjustYaw

adjustYaw: number

Used to make an adjustment to the yaw of the bone

boneSearch playground for bone

bone: Bone

The bone that will be looking to the target

meshSearch playground for mesh

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

slerpAmountSearch playground for slerpAmount

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)

targetSearch playground for target

target: Vector3

The target Vector3 that the bone will look at

upAxisSearch playground for upAxis

upAxis: Vector3

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

upAxisSpaceSearch playground for upAxisSpace

upAxisSpace: Space

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

Accessors

maxPitch

  • get maxPitch(): number
  • set maxPitch(value: number): any
  • 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 any

maxYaw

  • get maxYaw(): number
  • set maxYaw(value: number): any
  • 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 any

minPitch

  • get minPitch(): number
  • set minPitch(value: number): any
  • 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 any

minYaw

  • get minYaw(): number
  • set minYaw(value: number): any
  • 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 any

Methods

updateSearch playground for update

  • 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
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method