Skip to content

Commit 2ccb64e

Browse files
use waitForTileContentReady
1 parent fa668dd commit 2ccb64e

File tree

2 files changed

+33
-38
lines changed

2 files changed

+33
-38
lines changed

packages/engine/Specs/Scene/GaussianSplat3DTileContentSpec.js

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -57,46 +57,41 @@ describe(
5757
new HeadingPitchRange(0.0, -1.57, tileset.boundingSphere.radius),
5858
);
5959

60-
return Cesium3DTilesTester.waitForTileContent(
60+
return Cesium3DTilesTester.waitForTileContentReady(
6161
scene,
6262
tileset.root,
6363
).then(function (tile) {
64-
return Cesium3DTilesTester.waitForTileContentReady(
65-
scene,
66-
tile,
67-
).then(function (tile) {
68-
const content = tile.content;
69-
expect(content).toBeDefined();
70-
expect(content instanceof GaussianSplat3DTileContent).toBe(true);
71-
72-
const splatPrimitive = content.splatPrimitive;
73-
expect(splatPrimitive).toBeDefined();
74-
expect(splatPrimitive.attributes.length).toBeGreaterThan(0);
75-
const positions = ModelUtility.getAttributeBySemantic(
76-
splatPrimitive,
77-
VertexAttributeSemantic.POSITION,
78-
).typedArray;
79-
80-
const rotations = ModelUtility.getAttributeBySemantic(
81-
splatPrimitive,
82-
VertexAttributeSemantic.ROTATION,
83-
).typedArray;
84-
85-
const scales = ModelUtility.getAttributeBySemantic(
86-
splatPrimitive,
87-
VertexAttributeSemantic.SCALE,
88-
).typedArray;
89-
90-
const colors = ModelUtility.getAttributeBySemantic(
91-
splatPrimitive,
92-
VertexAttributeSemantic.COLOR,
93-
).typedArray;
94-
95-
expect(positions.length).toBeGreaterThan(0);
96-
expect(rotations.length).toBeGreaterThan(0);
97-
expect(scales.length).toBeGreaterThan(0);
98-
expect(colors.length).toBeGreaterThan(0);
99-
});
64+
const content = tile.content;
65+
expect(content).toBeDefined();
66+
expect(content instanceof GaussianSplat3DTileContent).toBe(true);
67+
68+
const splatPrimitive = content.splatPrimitive;
69+
expect(splatPrimitive).toBeDefined();
70+
expect(splatPrimitive.attributes.length).toBeGreaterThan(0);
71+
const positions = ModelUtility.getAttributeBySemantic(
72+
splatPrimitive,
73+
VertexAttributeSemantic.POSITION,
74+
).typedArray;
75+
76+
const rotations = ModelUtility.getAttributeBySemantic(
77+
splatPrimitive,
78+
VertexAttributeSemantic.ROTATION,
79+
).typedArray;
80+
81+
const scales = ModelUtility.getAttributeBySemantic(
82+
splatPrimitive,
83+
VertexAttributeSemantic.SCALE,
84+
).typedArray;
85+
86+
const colors = ModelUtility.getAttributeBySemantic(
87+
splatPrimitive,
88+
VertexAttributeSemantic.COLOR,
89+
).typedArray;
90+
91+
expect(positions.length).toBeGreaterThan(0);
92+
expect(rotations.length).toBeGreaterThan(0);
93+
expect(scales.length).toBeGreaterThan(0);
94+
expect(colors.length).toBeGreaterThan(0);
10095
});
10196
},
10297
);

packages/engine/Specs/Scene/GaussianSplatPrimitiveSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe(
6464
),
6565
).toBe(true);
6666

67-
return Cesium3DTilesTester.waitForTileContent(
67+
return Cesium3DTilesTester.waitForTileContentReady(
6868
scene,
6969
tileset.root,
7070
).then(function (tile) {

0 commit comments

Comments
 (0)