Skip to content

Commit ce8c00c

Browse files
committed
2D scaling fix
1 parent 793cff0 commit ce8c00c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/engine/Source/Scene/Model/ModelInstance.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class ModelInstance {
192192
* const boundingSphere = modelInstance.getBoundingSphere(model);
193193
* viewer.camera.flyToBoundingSphere(boundingSphere);
194194
*/
195-
getBoundingSphere(model, result) {
195+
getBoundingSphere(model, useBoundingSphere2D, mapProjection, result) {
196196
const modelMatrix = model.modelMatrix;
197197
const sceneGraph = model.sceneGraph;
198198
const instanceBoundingSpheres = [];
@@ -206,8 +206,8 @@ class ModelInstance {
206206
sceneGraph,
207207
runtimeNode,
208208
primitiveBoundingSphere,
209-
false,
210-
undefined,
209+
useBoundingSphere2D,
210+
mapProjection,
211211
);
212212
instanceBoundingSpheres.push(boundingSphere);
213213
}
@@ -254,7 +254,13 @@ class ModelInstance {
254254
let scale = model.scale;
255255
const radius = model.sceneGraph.rootBoundingSphere.radius;
256256

257-
const boundingSphere = this.getBoundingSphere(model, scratchBoundingSphere);
257+
const boundingSphere = this.getBoundingSphere(
258+
model,
259+
useModelMatrix2D,
260+
frameState.mapProjection,
261+
scratchBoundingSphere,
262+
);
263+
258264
const scaleInPixels = frameState.camera.getPixelSize(
259265
boundingSphere,
260266
frameState.context.drawingBufferWidth,

0 commit comments

Comments
 (0)