@@ -122,7 +122,7 @@ function buildDrawCommandForModel(
122
122
frameState . mode !== SceneMode . SCENE3D && ! useBoundingSphere2D ;
123
123
124
124
const runtimeNode = primitiveRenderResources . runtimeNode ;
125
- const modelMatrix = ModelDrawCommands . createCommandModelMatrix (
125
+ const commandModelMatrix = ModelDrawCommands . createCommandModelMatrix (
126
126
model . modelMatrix ,
127
127
sceneGraph ,
128
128
runtimeNode ,
@@ -135,7 +135,8 @@ function buildDrawCommandForModel(
135
135
? runtimePrimitive . boundingSphere2D
136
136
: runtimePrimitive . boundingSphere ;
137
137
const boundingSphere = ModelDrawCommands . createCommandBoundingSphere (
138
- model . modelMatrix ,
138
+ model ,
139
+ commandModelMatrix ,
139
140
sceneGraph ,
140
141
runtimeNode ,
141
142
primitiveBoundingSphere ,
@@ -150,7 +151,7 @@ function buildDrawCommandForModel(
150
151
) ;
151
152
152
153
renderState . cull . face = ModelUtility . getCullFace (
153
- modelMatrix ,
154
+ commandModelMatrix ,
154
155
primitiveRenderResources . primitiveType ,
155
156
) ;
156
157
renderState = RenderState . fromCache ( renderState ) ;
@@ -170,7 +171,7 @@ function buildDrawCommandForModel(
170
171
171
172
const command = new DrawCommand ( {
172
173
boundingVolume : boundingSphere ,
173
- modelMatrix : modelMatrix ,
174
+ modelMatrix : commandModelMatrix ,
174
175
uniformMap : primitiveRenderResources . uniformMap ,
175
176
renderState : renderState ,
176
177
vertexArray : vertexArray ,
@@ -248,6 +249,7 @@ ModelDrawCommands.createCommandModelMatrix = function (
248
249
* @returns {BoundingSphere }
249
250
*/
250
251
ModelDrawCommands . createCommandBoundingSphere = function (
252
+ model ,
251
253
commandModelMatrix ,
252
254
sceneGraph ,
253
255
runtimeNode ,
@@ -265,7 +267,7 @@ ModelDrawCommands.createCommandBoundingSphere = function (
265
267
266
268
for ( const modelInstance of sceneGraph . modelInstances . _instances ) {
267
269
const boundingSphere = modelInstance . getPrimitiveBoundingSphere (
268
- commandModelMatrix ,
270
+ model . modelMatrix ,
269
271
sceneGraph ,
270
272
runtimeNode ,
271
273
primitiveBoundingSphere ,
@@ -297,7 +299,7 @@ ModelDrawCommands.updateDrawCommand = function (
297
299
const useModelMatrix2D =
298
300
frameState . mode !== SceneMode . SCENE3D && ! useBoundingSphere2D ;
299
301
300
- const modelMatrix = ModelDrawCommands . createCommandModelMatrix (
302
+ const commandModelMatrix = ModelDrawCommands . createCommandModelMatrix (
301
303
model . modelMatrix ,
302
304
sceneGraph ,
303
305
runtimeNode ,
@@ -306,7 +308,7 @@ ModelDrawCommands.updateDrawCommand = function (
306
308
) ;
307
309
308
310
drawCommand . cullFace = ModelUtility . getCullFace (
309
- modelMatrix ,
311
+ commandModelMatrix ,
310
312
drawCommand . primitiveType ,
311
313
) ;
312
314
@@ -315,7 +317,8 @@ ModelDrawCommands.updateDrawCommand = function (
315
317
? runtimePrimitive . boundingSphere2D
316
318
: runtimePrimitive . boundingSphere ;
317
319
ModelDrawCommands . createCommandBoundingSphere (
318
- model . modelMatrix ,
320
+ model ,
321
+ commandModelMatrix ,
319
322
sceneGraph ,
320
323
runtimeNode ,
321
324
primitiveBoundingSphere ,
0 commit comments