@babylonjs/loaders 9.33.2 → 9.34.0
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/FBX/fbxFileLoader.pure.d.ts +2 -1
- package/FBX/fbxFileLoader.pure.js +5 -2
- package/FBX/fbxFileLoader.pure.js.map +1 -1
- package/SPLAT/splatFileLoader.pure.js +2 -2
- package/SPLAT/splatFileLoader.pure.js.map +1 -1
- package/SPLAT/spz.d.ts +4 -0
- package/SPLAT/spz.js +5 -1
- package/SPLAT/spz.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.d.ts +6 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.js +9 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.pure.d.ts +55 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.pure.js +207 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.pure.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.types.d.ts +25 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.types.js +2 -0
- package/glTF/2.0/Extensions/KHR_gaussian_splatting_compression_spz.types.js.map +1 -0
- package/glTF/2.0/Extensions/dynamic.js +10 -0
- package/glTF/2.0/Extensions/dynamic.js.map +1 -1
- package/glTF/2.0/Extensions/index.d.ts +1 -0
- package/glTF/2.0/Extensions/index.js +1 -0
- package/glTF/2.0/Extensions/index.js.map +1 -1
- package/glTF/2.0/Extensions/pure.d.ts +1 -0
- package/glTF/2.0/Extensions/pure.js +1 -0
- package/glTF/2.0/Extensions/pure.js.map +1 -1
- package/package.json +4 -3
|
@@ -293,7 +293,8 @@ export declare class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoa
|
|
|
293
293
|
/**
|
|
294
294
|
* Baked keys are interpolated linearly by Babylon. Between two frames an FBX cubic segment can deviate from that
|
|
295
295
|
* line, so sample times are refined (midpoints inserted, up to two levels) wherever the interpolated transform
|
|
296
|
-
* differs noticeably from the curve.
|
|
296
|
+
* differs noticeably from the curve. Rotations are normalized so quaternion length error cannot trigger subdivision.
|
|
297
|
+
* Flat and linear segments stay at frame resolution.
|
|
297
298
|
*/
|
|
298
299
|
private static _refineSampleTimes;
|
|
299
300
|
/**
|
|
@@ -2452,6 +2452,7 @@ export class FBXFileLoader {
|
|
|
2452
2452
|
if (!sampledModelIds.has(boneData.modelId) || !md || cn.length === 0) {
|
|
2453
2453
|
continue;
|
|
2454
2454
|
}
|
|
2455
|
+
// Refine the original intervals for every bone so the depth limit applies to the whole rig.
|
|
2455
2456
|
for (const time of FBXFileLoader._refineSampleTimes(baseTimes, (time) => this._sampleModelLocalMatrix(md, cn, time))) {
|
|
2456
2457
|
refinedTimes.add(time);
|
|
2457
2458
|
}
|
|
@@ -2648,7 +2649,8 @@ export class FBXFileLoader {
|
|
|
2648
2649
|
/**
|
|
2649
2650
|
* Baked keys are interpolated linearly by Babylon. Between two frames an FBX cubic segment can deviate from that
|
|
2650
2651
|
* line, so sample times are refined (midpoints inserted, up to two levels) wherever the interpolated transform
|
|
2651
|
-
* differs noticeably from the curve.
|
|
2652
|
+
* differs noticeably from the curve. Rotations are normalized so quaternion length error cannot trigger subdivision.
|
|
2653
|
+
* Flat and linear segments stay at frame resolution.
|
|
2652
2654
|
*/
|
|
2653
2655
|
static _refineSampleTimes(times, sample, maxDepth = 2) {
|
|
2654
2656
|
const decompose = (time) => {
|
|
@@ -2656,6 +2658,7 @@ export class FBXFileLoader {
|
|
|
2656
2658
|
const r = new Quaternion();
|
|
2657
2659
|
const t = new Vector3();
|
|
2658
2660
|
sample(time).decompose(s, r, t);
|
|
2661
|
+
r.normalize();
|
|
2659
2662
|
return { s, r, t };
|
|
2660
2663
|
};
|
|
2661
2664
|
const out = [];
|
|
@@ -2670,7 +2673,7 @@ export class FBXFileLoader {
|
|
|
2670
2673
|
const dm = decompose(tm);
|
|
2671
2674
|
const lerpT = Vector3.Lerp(d0.t, d1.t, 0.5);
|
|
2672
2675
|
const lerpS = Vector3.Lerp(d0.s, d1.s, 0.5);
|
|
2673
|
-
const slerpR = Quaternion.Slerp(d0.r, d1.r, 0.5);
|
|
2676
|
+
const slerpR = Quaternion.Slerp(d0.r, d1.r, 0.5).normalize();
|
|
2674
2677
|
const posErr = Vector3.Distance(lerpT, dm.t);
|
|
2675
2678
|
const sclErr = Vector3.Distance(lerpS, dm.s);
|
|
2676
2679
|
const dot = Math.min(1, Math.abs(Quaternion.Dot(slerpR, dm.r)));
|