Class BoneLookController
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;
useAbsoluteValueForYaw?: boolean;
yawAxis?: Vector3;
},
): BoneLookControllerCreate 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
- mesh: TransformNode
Properties
adjust Pitch
Used to make an adjustment to the pitch of the bone
adjust Roll
Used to make an adjustment to the roll of the bone
adjust Yaw
Used to make an adjustment to the yaw of the bone
bone
The bone that will be looking to the target
mesh
The TransformNode that the bone is attached to Name kept as mesh for back compatibility
slerp Amount
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
The target Vector3 that the bone will look at
up Axis
The up axis of the coordinate system that is used when the bone is rotated
up Axis Space
The space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD
use Absolute Value For Yaw
Use the absolute value for yaw when checking the min/max constraints
Accessors
max Pitch
-
get maxPitch(): number
Gets or sets the maximum pitch angle that the bone can look to
Returns number
-
set maxPitch(value: number): void
Parameters
- value: number
Returns void
max Yaw
-
get maxYaw(): number
Gets or sets the maximum yaw angle that the bone can look to
Returns number
-
set maxYaw(value: number): void
Parameters
- value: number
Returns void
min Pitch
-
get minPitch(): number
Gets or sets the minimum pitch angle that the bone can look to
Returns number
-
set minPitch(value: number): void
Parameters
- value: number
Returns void
min Yaw
-
get minYaw(): number
Gets or sets the minimum yaw angle that the bone can look to
Returns number
-
set minYaw(value: number): void
Parameters
- value: number
Returns void
Class used to make a bone look toward a point in space
See
https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons#bonelookcontroller