Skip to content

Commit e0e032f

Browse files
committed
Added test
1 parent e53672d commit e0e032f

File tree

11 files changed

+251
-1
lines changed

11 files changed

+251
-1
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
{
2+
"asset": {
3+
"version": "0.0"
4+
},
5+
"geometricError": 17.32,
6+
"root": {
7+
"boundingVolume": {
8+
"box": [
9+
0,
10+
0,
11+
0,
12+
5,
13+
0,
14+
0,
15+
0,
16+
5,
17+
0,
18+
0,
19+
0,
20+
5
21+
]
22+
},
23+
"transform": [
24+
0.968635634376879,
25+
0.24848542777253735,
26+
0,
27+
0,
28+
-0.15986460794399626,
29+
0.6231776137472074,
30+
0.7655670897127491,
31+
0,
32+
0.190232265775849,
33+
-0.7415555636019701,
34+
0.6433560687121489,
35+
0,
36+
1215012.8828876738,
37+
-4736313.051199594,
38+
4081605.22126042,
39+
1
40+
],
41+
"geometricError": 8.66,
42+
"refine": "ADD",
43+
"content": {
44+
"url": "parent.pnts"
45+
},
46+
"children": [
47+
{
48+
"boundingVolume": {
49+
"box": [
50+
-2.5,
51+
-2.5,
52+
-2.5,
53+
2.5,
54+
0,
55+
0,
56+
0,
57+
2.5,
58+
0,
59+
0,
60+
0,
61+
2.5
62+
]
63+
},
64+
"geometricError": 0,
65+
"content": {
66+
"url": "0.pnts"
67+
}
68+
},
69+
{
70+
"boundingVolume": {
71+
"box": [
72+
-2.5,
73+
2.5,
74+
2.5,
75+
2.5,
76+
0,
77+
0,
78+
0,
79+
2.5,
80+
0,
81+
0,
82+
0,
83+
2.5
84+
]
85+
},
86+
"geometricError": 0,
87+
"content": {
88+
"url": "1.pnts"
89+
}
90+
},
91+
{
92+
"boundingVolume": {
93+
"box": [
94+
-2.5,
95+
-2.5,
96+
2.5,
97+
2.5,
98+
0,
99+
0,
100+
0,
101+
2.5,
102+
0,
103+
0,
104+
0,
105+
2.5
106+
]
107+
},
108+
"geometricError": 0,
109+
"content": {
110+
"url": "2.pnts"
111+
}
112+
},
113+
{
114+
"boundingVolume": {
115+
"box": [
116+
-2.5,
117+
2.5,
118+
-2.5,
119+
2.5,
120+
0,
121+
0,
122+
0,
123+
2.5,
124+
0,
125+
0,
126+
0,
127+
2.5
128+
]
129+
},
130+
"geometricError": 0,
131+
"content": {
132+
"url": "3.pnts"
133+
}
134+
},
135+
{
136+
"boundingVolume": {
137+
"box": [
138+
2.5,
139+
-2.5,
140+
-2.5,
141+
2.5,
142+
0,
143+
0,
144+
0,
145+
2.5,
146+
0,
147+
0,
148+
0,
149+
2.5
150+
]
151+
},
152+
"geometricError": 0,
153+
"content": {
154+
"url": "4.pnts"
155+
}
156+
},
157+
{
158+
"boundingVolume": {
159+
"box": [
160+
2.5,
161+
2.5,
162+
-2.5,
163+
2.5,
164+
0,
165+
0,
166+
0,
167+
2.5,
168+
0,
169+
0,
170+
0,
171+
2.5
172+
]
173+
},
174+
"geometricError": 0,
175+
"content": {
176+
"url": "5.pnts"
177+
}
178+
},
179+
{
180+
"boundingVolume": {
181+
"box": [
182+
2.5,
183+
-2.5,
184+
2.5,
185+
2.5,
186+
0,
187+
0,
188+
0,
189+
2.5,
190+
0,
191+
0,
192+
0,
193+
2.5
194+
]
195+
},
196+
"geometricError": 0,
197+
"content": {
198+
"url": "6.pnts"
199+
}
200+
},
201+
{
202+
"boundingVolume": {
203+
"box": [
204+
2.5,
205+
2.5,
206+
2.5,
207+
2.5,
208+
0,
209+
0,
210+
0,
211+
2.5,
212+
0,
213+
0,
214+
0,
215+
2.5
216+
]
217+
},
218+
"geometricError": 0,
219+
"content": {
220+
"url": "7.pnts"
221+
}
222+
}
223+
]
224+
}
225+
}

Specs/Scene/PointCloud3DTileContentSpec.js

+26-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ defineSuite([
1111
'Core/PerspectiveFrustum',
1212
'Core/Plane',
1313
'Core/Transforms',
14+
'Renderer/Pass',
1415
'Scene/Cesium3DTileStyle',
1516
'Scene/Expression',
1617
'Specs/Cesium3DTilesTester',
@@ -29,6 +30,7 @@ defineSuite([
2930
PerspectiveFrustum,
3031
Plane,
3132
Transforms,
33+
Pass,
3234
Cesium3DTileStyle,
3335
Expression,
3436
Cesium3DTilesTester,
@@ -53,6 +55,7 @@ defineSuite([
5355
var pointCloudBatchedUrl = './Data/Cesium3DTiles/PointCloud/PointCloudBatched';
5456
var pointCloudWithPerPointPropertiesUrl = './Data/Cesium3DTiles/PointCloud/PointCloudWithPerPointProperties';
5557
var pointCloudWithTransformUrl = './Data/Cesium3DTiles/PointCloud/PointCloudWithTransform';
58+
var pointCloudTilesetUrl = './Data/Cesium3DTiles/Tilesets/TilesetPoints';
5659

5760
function setCamera(longitude, latitude) {
5861
// Point the camera to the center of the tile
@@ -539,7 +542,7 @@ defineSuite([
539542
});
540543

541544
it('rebuilds shader style when expression changes', function() {
542-
return Cesium3DTilesTester.loadTileset(scene, pointCloudWithPerPointPropertiesUrl).then(function(tileset) {
545+
return Cesium3DTilesTester.loadTileset(scene, pointCloudTilesetUrl).then(function(tileset) {
543546
// Solid red color
544547
tileset.style = new Cesium3DTileStyle({
545548
color : 'color("red")'
@@ -549,6 +552,28 @@ defineSuite([
549552
tileset.style.color = new Expression('color("lime")');
550553
tileset.makeStyleDirty();
551554
expect(scene).toRender([0, 255, 0, 255]);
555+
556+
tileset.style.color = new Expression('color("blue", 0.5)');
557+
tileset.makeStyleDirty();
558+
expect(scene).toRender([0, 0, 255, 255]);
559+
560+
var i;
561+
var commands = scene.frameState.commandList;
562+
var commandsLength = commands.length;
563+
expect(commandsLength).toBeGreaterThan(1); // Just check that at least some children are rendered
564+
for (i = 0; i < commandsLength; ++i) {
565+
expect(commands[i].pass).toBe(Pass.TRANSLUCENT);
566+
}
567+
568+
tileset.style.color = new Expression('color("yellow")');
569+
tileset.makeStyleDirty();
570+
expect(scene).toRender([255, 255, 0, 255]);
571+
572+
commands = scene.frameState.commandList;
573+
commandsLength = commands.length;
574+
for (i = 0; i < commandsLength; ++i) {
575+
expect(commands[i].pass).not.toBe(Pass.TRANSLUCENT);
576+
}
552577
});
553578
});
554579

0 commit comments

Comments
 (0)