Skip to content

Commit 912aa0d

Browse files
committed
Test and fix opening scene with empty bbox
1 parent c980e3a commit 912aa0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

code/gameinitialize.pas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ procedure InitializeSceneBoundingBox;
394394
Material: TMaterialNode;
395395
begin
396396
BBox := Window.MainScene.BoundingBox;
397+
if BBox.IsEmpty then Exit;
398+
397399
BBoxGeometry := TBoxNode.Create;
398400
BBoxGeometry.Size := BBox.Size;
399401

@@ -449,6 +451,8 @@ procedure OpenScene(const Url: string);
449451
Application.Log(etInfo, 'Opened ' + Url);
450452

451453
Window.Load(Url);
454+
// Only to test loading empty scene (with empty bbox)
455+
// Window.Load('data:model/vrml,#VRML V2.0 utf8' + NL + 'Group { }');
452456
Window.MainScene.Spatial := [ssRendering, ssDynamicCollisions];
453457
Window.MainScene.ProcessEvents := true;
454458

0 commit comments

Comments
 (0)