@woosh/meep-engine 2.92.23 → 2.93.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/meep.cjs +99 -129
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +99 -129
- package/package.json +6 -4
- package/src/core/geom/Quaternion.d.ts +29 -14
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +63 -99
- package/src/core/math/spline/spline_hermite3.d.ts +4 -3
- package/src/core/math/spline/spline_hermite3.d.ts.map +1 -1
- package/src/core/math/spline/spline_hermite3.js +4 -3
- package/src/engine/animation/clip/AnimationClip.d.ts +4 -0
- package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationClip.js +23 -0
- package/src/engine/animation/clip/AnimationClipBinding.d.ts +14 -0
- package/src/engine/animation/clip/AnimationClipBinding.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationClipBinding.js +94 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts +45 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationTrack.js +83 -0
- package/src/engine/animation/clip/AnimationTrackBinding.d.ts +25 -0
- package/src/engine/animation/clip/AnimationTrackBinding.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationTrackBinding.js +42 -0
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts +9 -0
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -0
- package/src/engine/animation/{curve → clip}/ecd_bind_animation_curve.js +28 -20
- package/src/engine/animation/curve/AnimationCurve.d.ts +31 -0
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +81 -23
- package/src/engine/animation/curve/AnimationCurve.spec.js +37 -2
- package/src/engine/animation/curve/Keyframe.d.ts +8 -0
- package/src/engine/animation/curve/Keyframe.d.ts.map +1 -1
- package/src/engine/animation/curve/Keyframe.js +53 -44
- package/src/engine/animation/curve/Keyframe.spec.d.ts +2 -0
- package/src/engine/animation/curve/Keyframe.spec.d.ts.map +1 -0
- package/src/engine/animation/curve/Keyframe.spec.js +31 -0
- package/src/engine/animation/curve/binding/BoundQuaternionWriter.d.ts.map +1 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts +14 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts.map +1 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.js +19 -0
- package/src/engine/animation/curve/binding/BoundVector3Writer.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.d.ts +2 -2
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js +5 -3
- package/src/engine/animation/curve/EntityNodeAnimationClip.d.ts +0 -4
- package/src/engine/animation/curve/EntityNodeAnimationClip.d.ts.map +0 -1
- package/src/engine/animation/curve/EntityNodeAnimationClip.js +0 -24
- package/src/engine/animation/curve/ecd_bind_animation_curve.d.ts +0 -8
- package/src/engine/animation/curve/ecd_bind_animation_curve.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/AnimatedValueBinding.d.ts +0 -27
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/AnimatedValueBinding.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/AnimatedValueBinding.js +0 -61
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/BoundQuaternionWriter.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/BoundValueWriter.d.ts +0 -8
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/BoundValueWriter.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/BoundValueWriter.js +0 -10
- package/src/engine/graphics/ecs/mesh-v2/aggregate/animation/BoundVector3Writer.d.ts.map +0 -1
- /package/src/engine/{graphics/ecs/mesh-v2/aggregate/animation → animation/curve/binding}/BoundQuaternionWriter.d.ts +0 -0
- /package/src/engine/{graphics/ecs/mesh-v2/aggregate/animation → animation/curve/binding}/BoundQuaternionWriter.js +0 -0
- /package/src/engine/{graphics/ecs/mesh-v2/aggregate/animation → animation/curve/binding}/BoundVector3Writer.d.ts +0 -0
- /package/src/engine/{graphics/ecs/mesh-v2/aggregate/animation → animation/curve/binding}/BoundVector3Writer.js +0 -0
package/build/meep.cjs
CHANGED
|
@@ -3145,6 +3145,9 @@ const forward = new Vector3$1();
|
|
|
3145
3145
|
const up = new Vector3$1();
|
|
3146
3146
|
const right = new Vector3$1();
|
|
3147
3147
|
|
|
3148
|
+
const sin$1 = Math.sin;
|
|
3149
|
+
const cos$1 = Math.cos;
|
|
3150
|
+
|
|
3148
3151
|
let Quaternion$1 = class Quaternion {
|
|
3149
3152
|
/**
|
|
3150
3153
|
*
|
|
@@ -3180,6 +3183,8 @@ let Quaternion$1 = class Quaternion {
|
|
|
3180
3183
|
this.onChanged = new Signal();
|
|
3181
3184
|
}
|
|
3182
3185
|
|
|
3186
|
+
// Making Quaternion comply to array interface
|
|
3187
|
+
|
|
3183
3188
|
get 0() {
|
|
3184
3189
|
return this.x;
|
|
3185
3190
|
}
|
|
@@ -3212,6 +3217,19 @@ let Quaternion$1 = class Quaternion {
|
|
|
3212
3217
|
this.w = v;
|
|
3213
3218
|
}
|
|
3214
3219
|
|
|
3220
|
+
/**
|
|
3221
|
+
* Making quaternion iterable
|
|
3222
|
+
*/
|
|
3223
|
+
* [Symbol.iterator]() {
|
|
3224
|
+
|
|
3225
|
+
yield this.x;
|
|
3226
|
+
yield this.y;
|
|
3227
|
+
yield this.z;
|
|
3228
|
+
yield this.w;
|
|
3229
|
+
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
|
|
3215
3233
|
/**
|
|
3216
3234
|
*
|
|
3217
3235
|
* @param {number} fx forward vector
|
|
@@ -3252,58 +3270,22 @@ let Quaternion$1 = class Quaternion {
|
|
|
3252
3270
|
|
|
3253
3271
|
// construct partial transform matrix
|
|
3254
3272
|
const m00 = right.x;
|
|
3255
|
-
const
|
|
3256
|
-
const
|
|
3257
|
-
const m10 = up.x;
|
|
3258
|
-
const m11 = up.y;
|
|
3259
|
-
const m12 = up.z;
|
|
3260
|
-
const m20 = forward.x;
|
|
3261
|
-
const m21 = forward.y;
|
|
3262
|
-
const m22 = forward.z;
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
const num8 = (m00 + m11) + m22;
|
|
3266
|
-
|
|
3267
|
-
let _x, _y, _z, _w;
|
|
3268
|
-
|
|
3269
|
-
if (num8 > 0) {
|
|
3270
|
-
let num = Math.sqrt(num8 + 1);
|
|
3271
|
-
_w = num * 0.5;
|
|
3272
|
-
num = 0.5 / num;
|
|
3273
|
-
_x = (m12 - m21) * num;
|
|
3274
|
-
_y = (m20 - m02) * num;
|
|
3275
|
-
_z = (m01 - m10) * num;
|
|
3276
|
-
} else if ((m00 >= m11) && (m00 >= m22)) {
|
|
3277
|
-
|
|
3278
|
-
const num7 = Math.sqrt(((1 + m00) - m11) - m22);
|
|
3279
|
-
const num4 = 0.5 / num7;
|
|
3280
|
-
|
|
3281
|
-
_x = 0.5 * num7;
|
|
3282
|
-
_y = (m01 + m10) * num4;
|
|
3283
|
-
_z = (m02 + m20) * num4;
|
|
3284
|
-
_w = (m12 - m21) * num4;
|
|
3285
|
-
|
|
3286
|
-
} else if (m11 > m22) {
|
|
3273
|
+
const m10 = right.y;
|
|
3274
|
+
const m20 = right.z;
|
|
3287
3275
|
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
_x = (m10 + m01) * num3;
|
|
3292
|
-
_y = 0.5 * num6;
|
|
3293
|
-
_z = (m21 + m12) * num3;
|
|
3294
|
-
_w = (m20 - m02) * num3;
|
|
3295
|
-
} else {
|
|
3296
|
-
|
|
3297
|
-
const num5 = Math.sqrt(((1 + m22) - m00) - m11);
|
|
3298
|
-
const num2 = 0.5 / num5;
|
|
3276
|
+
const m01 = up.x;
|
|
3277
|
+
const m11 = up.y;
|
|
3278
|
+
const m21 = up.z;
|
|
3299
3279
|
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
_w = (m01 - m10) * num2;
|
|
3304
|
-
}
|
|
3280
|
+
const m02 = forward.x;
|
|
3281
|
+
const m12 = forward.y;
|
|
3282
|
+
const m22 = forward.z;
|
|
3305
3283
|
|
|
3306
|
-
this.
|
|
3284
|
+
this.__setFromRotationMatrix(
|
|
3285
|
+
m00, m01, m02,
|
|
3286
|
+
m10, m11, m12,
|
|
3287
|
+
m20, m21, m22
|
|
3288
|
+
);
|
|
3307
3289
|
}
|
|
3308
3290
|
|
|
3309
3291
|
/**
|
|
@@ -3311,13 +3293,24 @@ let Quaternion$1 = class Quaternion {
|
|
|
3311
3293
|
* @param {Vector3} vForward
|
|
3312
3294
|
* @param {Vector3} [vUp=Vector3.up]
|
|
3313
3295
|
*
|
|
3314
|
-
* @source http://answers.unity3d.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html
|
|
3315
3296
|
*/
|
|
3316
3297
|
lookRotation(vForward, vUp = Vector3$1.up) {
|
|
3317
3298
|
|
|
3318
3299
|
this._lookRotation(vForward.x, vForward.y, vForward.z, vUp.x, vUp.y, vUp.z);
|
|
3319
3300
|
}
|
|
3320
3301
|
|
|
3302
|
+
/**
|
|
3303
|
+
*
|
|
3304
|
+
* @param {Quaternion} other
|
|
3305
|
+
* @return {number}
|
|
3306
|
+
*/
|
|
3307
|
+
dot(other) {
|
|
3308
|
+
return this.x * other.x
|
|
3309
|
+
+ this.y * other.y
|
|
3310
|
+
+ this.z * other.z
|
|
3311
|
+
+ this.w * other.w
|
|
3312
|
+
;
|
|
3313
|
+
}
|
|
3321
3314
|
|
|
3322
3315
|
/**
|
|
3323
3316
|
*
|
|
@@ -3337,14 +3330,14 @@ let Quaternion$1 = class Quaternion {
|
|
|
3337
3330
|
const z = this.z;
|
|
3338
3331
|
const w = this.w;
|
|
3339
3332
|
|
|
3340
|
-
const
|
|
3333
|
+
const length_sqr = x * x + y * y + z * z + w * w;
|
|
3341
3334
|
|
|
3342
|
-
if (
|
|
3335
|
+
if (length_sqr === 0) {
|
|
3343
3336
|
this.set(0, 0, 0, 0);
|
|
3344
3337
|
return;
|
|
3345
3338
|
}
|
|
3346
3339
|
|
|
3347
|
-
const invDot = 1.0 /
|
|
3340
|
+
const invDot = 1.0 / length_sqr;
|
|
3348
3341
|
|
|
3349
3342
|
const _x = -x * invDot;
|
|
3350
3343
|
const _y = -y * invDot;
|
|
@@ -3398,8 +3391,8 @@ let Quaternion$1 = class Quaternion {
|
|
|
3398
3391
|
_fromAxisAngle(ax, ay, az, angle) {
|
|
3399
3392
|
const halfAngle = angle * 0.5;
|
|
3400
3393
|
|
|
3401
|
-
const sinA2 =
|
|
3402
|
-
const cosA2 =
|
|
3394
|
+
const sinA2 = sin$1(halfAngle);
|
|
3395
|
+
const cosA2 = cos$1(halfAngle);
|
|
3403
3396
|
|
|
3404
3397
|
const qx = ax * sinA2;
|
|
3405
3398
|
const qy = ay * sinA2;
|
|
@@ -3480,7 +3473,7 @@ let Quaternion$1 = class Quaternion {
|
|
|
3480
3473
|
toAxisAngle(axis) {
|
|
3481
3474
|
const rad = Math.acos(this.w) * 2.0;
|
|
3482
3475
|
|
|
3483
|
-
const s =
|
|
3476
|
+
const s = sin$1(rad * 0.5);
|
|
3484
3477
|
|
|
3485
3478
|
if (Math.abs(s) > EPSILON) {
|
|
3486
3479
|
axis.set(
|
|
@@ -3523,7 +3516,6 @@ let Quaternion$1 = class Quaternion {
|
|
|
3523
3516
|
}
|
|
3524
3517
|
|
|
3525
3518
|
/**
|
|
3526
|
-
* @see http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
|
|
3527
3519
|
* @param {Quaternion} other
|
|
3528
3520
|
*/
|
|
3529
3521
|
multiply(other) {
|
|
@@ -3563,6 +3555,8 @@ let Quaternion$1 = class Quaternion {
|
|
|
3563
3555
|
*/
|
|
3564
3556
|
_multiplyQuaternions(ax, ay, az, aw, bx, by, bz, bw) {
|
|
3565
3557
|
|
|
3558
|
+
// see http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
|
|
3559
|
+
|
|
3566
3560
|
const x = ax * bw + aw * bx + ay * bz - az * by;
|
|
3567
3561
|
const y = ay * bw + aw * by + az * bx - ax * bz;
|
|
3568
3562
|
const z = az * bw + aw * bz + ax * by - ay * bx;
|
|
@@ -3652,7 +3646,7 @@ let Quaternion$1 = class Quaternion {
|
|
|
3652
3646
|
* @param {number} x
|
|
3653
3647
|
* @param {number} y
|
|
3654
3648
|
* @param {number} z
|
|
3655
|
-
* @param {String} order a combination of capital letters X,Y,Z. Examples: XYZ, YXZ
|
|
3649
|
+
* @param {String} [order] a combination of capital letters X,Y,Z. Examples: XYZ, YXZ
|
|
3656
3650
|
* @returns {Quaternion}
|
|
3657
3651
|
*/
|
|
3658
3652
|
__setFromEuler(x, y, z, order = 'XYZ') {
|
|
@@ -3683,6 +3677,8 @@ let Quaternion$1 = class Quaternion {
|
|
|
3683
3677
|
|
|
3684
3678
|
this.fromEulerAnglesXZY(x, y, z);
|
|
3685
3679
|
|
|
3680
|
+
} else {
|
|
3681
|
+
throw new Error(`Invalid order '${order}', bust be 3 capital letters consisting of X,Y and Z`);
|
|
3686
3682
|
}
|
|
3687
3683
|
|
|
3688
3684
|
return this;
|
|
@@ -3807,16 +3803,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3807
3803
|
const half_y = y * 0.5;
|
|
3808
3804
|
const half_z = z * 0.5;
|
|
3809
3805
|
|
|
3810
|
-
const
|
|
3811
|
-
const
|
|
3806
|
+
const s1 = sin$1(half_x);
|
|
3807
|
+
const s2 = sin$1(half_y);
|
|
3808
|
+
const s3 = sin$1(half_z);
|
|
3812
3809
|
|
|
3813
|
-
const
|
|
3814
|
-
const
|
|
3815
|
-
const
|
|
3816
|
-
|
|
3817
|
-
const c1 = cos(half_x);
|
|
3818
|
-
const c2 = cos(half_y);
|
|
3819
|
-
const c3 = cos(half_z);
|
|
3810
|
+
const c1 = cos$1(half_x);
|
|
3811
|
+
const c2 = cos$1(half_y);
|
|
3812
|
+
const c3 = cos$1(half_z);
|
|
3820
3813
|
|
|
3821
3814
|
const _x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
3822
3815
|
const _y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
@@ -3840,16 +3833,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3840
3833
|
const scaled_y = y * 0.5;
|
|
3841
3834
|
const scaled_z = z * 0.5;
|
|
3842
3835
|
|
|
3843
|
-
const
|
|
3844
|
-
const
|
|
3845
|
-
|
|
3846
|
-
const s1 = sin(scaled_x);
|
|
3847
|
-
const s2 = sin(scaled_y);
|
|
3848
|
-
const s3 = sin(scaled_z);
|
|
3836
|
+
const s1 = sin$1(scaled_x);
|
|
3837
|
+
const s2 = sin$1(scaled_y);
|
|
3838
|
+
const s3 = sin$1(scaled_z);
|
|
3849
3839
|
|
|
3850
|
-
const c1 = cos(scaled_x);
|
|
3851
|
-
const c2 = cos(scaled_y);
|
|
3852
|
-
const c3 = cos(scaled_z);
|
|
3840
|
+
const c1 = cos$1(scaled_x);
|
|
3841
|
+
const c2 = cos$1(scaled_y);
|
|
3842
|
+
const c3 = cos$1(scaled_z);
|
|
3853
3843
|
|
|
3854
3844
|
const _x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
3855
3845
|
const _y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
@@ -3873,16 +3863,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3873
3863
|
const scaled_y = y * 0.5;
|
|
3874
3864
|
const scaled_z = z * 0.5;
|
|
3875
3865
|
|
|
3876
|
-
const
|
|
3877
|
-
const
|
|
3878
|
-
|
|
3879
|
-
const s1 = sin(scaled_x);
|
|
3880
|
-
const s2 = sin(scaled_y);
|
|
3881
|
-
const s3 = sin(scaled_z);
|
|
3866
|
+
const s1 = sin$1(scaled_x);
|
|
3867
|
+
const s2 = sin$1(scaled_y);
|
|
3868
|
+
const s3 = sin$1(scaled_z);
|
|
3882
3869
|
|
|
3883
|
-
const c1 = cos(scaled_x);
|
|
3884
|
-
const c2 = cos(scaled_y);
|
|
3885
|
-
const c3 = cos(scaled_z);
|
|
3870
|
+
const c1 = cos$1(scaled_x);
|
|
3871
|
+
const c2 = cos$1(scaled_y);
|
|
3872
|
+
const c3 = cos$1(scaled_z);
|
|
3886
3873
|
|
|
3887
3874
|
const _x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
3888
3875
|
const _y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
@@ -3906,16 +3893,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3906
3893
|
const scaled_y = y * 0.5;
|
|
3907
3894
|
const scaled_z = z * 0.5;
|
|
3908
3895
|
|
|
3909
|
-
const
|
|
3910
|
-
const
|
|
3896
|
+
const s1 = sin$1(scaled_x);
|
|
3897
|
+
const s2 = sin$1(scaled_y);
|
|
3898
|
+
const s3 = sin$1(scaled_z);
|
|
3911
3899
|
|
|
3912
|
-
const
|
|
3913
|
-
const
|
|
3914
|
-
const
|
|
3915
|
-
|
|
3916
|
-
const c1 = cos(scaled_x);
|
|
3917
|
-
const c2 = cos(scaled_y);
|
|
3918
|
-
const c3 = cos(scaled_z);
|
|
3900
|
+
const c1 = cos$1(scaled_x);
|
|
3901
|
+
const c2 = cos$1(scaled_y);
|
|
3902
|
+
const c3 = cos$1(scaled_z);
|
|
3919
3903
|
|
|
3920
3904
|
const _x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
3921
3905
|
const _y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
@@ -3939,16 +3923,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3939
3923
|
const scaled_y = y * 0.5;
|
|
3940
3924
|
const scaled_z = z * 0.5;
|
|
3941
3925
|
|
|
3942
|
-
const
|
|
3943
|
-
const
|
|
3944
|
-
|
|
3945
|
-
const s1 = sin(scaled_x);
|
|
3946
|
-
const s2 = sin(scaled_y);
|
|
3947
|
-
const s3 = sin(scaled_z);
|
|
3926
|
+
const s1 = sin$1(scaled_x);
|
|
3927
|
+
const s2 = sin$1(scaled_y);
|
|
3928
|
+
const s3 = sin$1(scaled_z);
|
|
3948
3929
|
|
|
3949
|
-
const c1 = cos(scaled_x);
|
|
3950
|
-
const c2 = cos(scaled_y);
|
|
3951
|
-
const c3 = cos(scaled_z);
|
|
3930
|
+
const c1 = cos$1(scaled_x);
|
|
3931
|
+
const c2 = cos$1(scaled_y);
|
|
3932
|
+
const c3 = cos$1(scaled_z);
|
|
3952
3933
|
|
|
3953
3934
|
const _x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
3954
3935
|
const _y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
@@ -3972,16 +3953,13 @@ let Quaternion$1 = class Quaternion {
|
|
|
3972
3953
|
const scaled_y = y * 0.5;
|
|
3973
3954
|
const scaled_z = z * 0.5;
|
|
3974
3955
|
|
|
3975
|
-
const
|
|
3976
|
-
const
|
|
3956
|
+
const s1 = sin$1(scaled_x);
|
|
3957
|
+
const s2 = sin$1(scaled_y);
|
|
3958
|
+
const s3 = sin$1(scaled_z);
|
|
3977
3959
|
|
|
3978
|
-
const
|
|
3979
|
-
const
|
|
3980
|
-
const
|
|
3981
|
-
|
|
3982
|
-
const c1 = cos(scaled_x);
|
|
3983
|
-
const c2 = cos(scaled_y);
|
|
3984
|
-
const c3 = cos(scaled_z);
|
|
3960
|
+
const c1 = cos$1(scaled_x);
|
|
3961
|
+
const c2 = cos$1(scaled_y);
|
|
3962
|
+
const c3 = cos$1(scaled_z);
|
|
3985
3963
|
|
|
3986
3964
|
const _x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
3987
3965
|
const _y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
@@ -4155,7 +4133,7 @@ let Quaternion$1 = class Quaternion {
|
|
|
4155
4133
|
}
|
|
4156
4134
|
|
|
4157
4135
|
/**
|
|
4158
|
-
*
|
|
4136
|
+
* @deprecated
|
|
4159
4137
|
* @param {Matrix4} m
|
|
4160
4138
|
*/
|
|
4161
4139
|
setFromRotationMatrix(m) {
|
|
@@ -4311,9 +4289,9 @@ let Quaternion$1 = class Quaternion {
|
|
|
4311
4289
|
if ((1.0 - cosom) > EPSILON) {
|
|
4312
4290
|
// standard case (slerp)
|
|
4313
4291
|
omega = Math.acos(cosom);
|
|
4314
|
-
sinom =
|
|
4315
|
-
scale0 =
|
|
4316
|
-
scale1 =
|
|
4292
|
+
sinom = sin$1(omega);
|
|
4293
|
+
scale0 = sin$1((1.0 - t) * omega) / sinom;
|
|
4294
|
+
scale1 = sin$1(t * omega) / sinom;
|
|
4317
4295
|
} else {
|
|
4318
4296
|
// "from" and "to" quaternions are very close
|
|
4319
4297
|
// ... so we can do a linear interpolation
|
|
@@ -4569,15 +4547,6 @@ let Quaternion$1 = class Quaternion {
|
|
|
4569
4547
|
&& epsilonEquals(this.w, w, tolerance);
|
|
4570
4548
|
}
|
|
4571
4549
|
|
|
4572
|
-
* [Symbol.iterator]() {
|
|
4573
|
-
|
|
4574
|
-
yield this.x;
|
|
4575
|
-
yield this.y;
|
|
4576
|
-
yield this.z;
|
|
4577
|
-
yield this.w;
|
|
4578
|
-
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
4550
|
/**
|
|
4582
4551
|
* Based on http://planning.cs.uiuc.edu/node198.html
|
|
4583
4552
|
* @param {function():number} [random]
|
|
@@ -4594,10 +4563,10 @@ let Quaternion$1 = class Quaternion {
|
|
|
4594
4563
|
const u3 = 2 * Math.PI * random();
|
|
4595
4564
|
|
|
4596
4565
|
return this.set(
|
|
4597
|
-
sqrt1u1 *
|
|
4598
|
-
sqrtu1 *
|
|
4599
|
-
sqrtu1 *
|
|
4600
|
-
sqrt1u1 *
|
|
4566
|
+
sqrt1u1 * cos$1(u2),
|
|
4567
|
+
sqrtu1 * sin$1(u3),
|
|
4568
|
+
sqrtu1 * cos$1(u3),
|
|
4569
|
+
sqrt1u1 * sin$1(u2),
|
|
4601
4570
|
);
|
|
4602
4571
|
}
|
|
4603
4572
|
|
|
@@ -4645,6 +4614,7 @@ let Quaternion$1 = class Quaternion {
|
|
|
4645
4614
|
const angle = from.angleTo(to);
|
|
4646
4615
|
|
|
4647
4616
|
if (angle === 0) {
|
|
4617
|
+
// we're already where we need tobe. Also - avoid division by 0
|
|
4648
4618
|
result.copy(to);
|
|
4649
4619
|
} else {
|
|
4650
4620
|
// clamp to 1, to make sure we don't overshoot
|