本文整理汇总了TypeScript中babylonjs/Maths/math.Quaternion.asArray方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Quaternion.asArray方法的具体用法?TypeScript Quaternion.asArray怎么用?TypeScript Quaternion.asArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类babylonjs/Maths/math.Quaternion
的用法示例。
在下文中一共展示了Quaternion.asArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _SetInterpolatedValue
private static _SetInterpolatedValue(babylonTransformNode: TransformNode, value: Nullable<number | Vector3 | Quaternion>, time: number, animation: Animation, animationChannelTargetPath: AnimationChannelTargetPath, quaternionCache: Quaternion, inputs: number[], outputs: number[][], convertToRightHandedSystem: boolean, useQuaternion: boolean) {
const animationType = animation.dataType;
let cacheValue: Vector3 | Quaternion;
inputs.push(time);
if (typeof value === "number") {
value = this._ConvertFactorToVector3OrQuaternion(value as number, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
}
if (value) {
if (animationChannelTargetPath === AnimationChannelTargetPath.ROTATION) {
if (useQuaternion) {
quaternionCache = value as Quaternion;
}
else {
cacheValue = value as Vector3;
Quaternion.RotationYawPitchRollToRef(cacheValue.y, cacheValue.x, cacheValue.z, quaternionCache);
}
if (convertToRightHandedSystem) {
_GLTFUtilities._GetRightHandedQuaternionFromRef(quaternionCache);
if (!babylonTransformNode.parent) {
quaternionCache = Quaternion.FromArray([0, 1, 0, 0]).multiply(quaternionCache);
}
}
outputs.push(quaternionCache.asArray());
}
else {
cacheValue = value as Vector3;
if (convertToRightHandedSystem && (animationChannelTargetPath !== AnimationChannelTargetPath.SCALE)) {
_GLTFUtilities._GetRightHandedPositionVector3FromRef(cacheValue);
if (!babylonTransformNode.parent) {
cacheValue.x *= -1;
cacheValue.z *= -1;
}
}
outputs.push(cacheValue.asArray());
}
}
}