Chapter 1 ClosedWorld 구현 - #1
Draft
eunseo-com wants to merge 16 commits into
Draft
Conversation
The shallow hasGeometry check only looked one level into the loaded node's children, but Piggy.usdc nests its meshes two levels down (wrapper -> root -> body/eyes/tail), so the check always evaluated false and silently overwrote the real model with the voxel fallback. Removed the redundant check and trust AssetLoader.object(named:fallback:)'s existing non-nil contract instead. Strengthened the geometry test with a deep enumerateHierarchy traversal (matching the pattern already used in boundingBox(of:)) and added a test asserting multiple meshes are placed, not the single-box fallback.
Adds a defer block to resign key status and stop the SCNView's display link after the test runs, so the offscreen UIWindow/SCNView never leaks across tests in the same process. Also documents why the test relies on the real display link + a generous 2.0s/0.5s timeout margin instead of a fully deterministic clock (the SCNRenderer manual-pump alternative crashes on this simulator runtime), and notes the expected makeKeyAndVisible() deprecation warning from the windowScene-less test window.
Wood_Color.usdc loads several meters larger than the 4x4x2.5m room, and FakeSofa.makeSofaNode() never rescaled it (unlike PigPlacement, which normalizes Piggy to a 0.6m standard height). Factor the bounding-box-based normalize helper out of PigPlacement into a shared SceneKitGeometry enum, and use it in FakeSofa to normalize the sofa to a 0.45m furniture-scale height. RoomBuilder's floor (Ground_Color.usdc) was also checked: its raw footprint is undersized relative to the 4x4m room, but its "thin" axis doesn't line up with the room's y-up convention the way the sofa/pig's does. Applying the same toHeight/toFootprintWidth scale uniformly inflates the wrong axis and ends up enveloping the camera (verified in the simulator), so it's left unnormalized rather than guess-fixed.
While re-verifying the FakeSofa scale fix in the simulator, the screenshot still showed a scene dominated by giant close-up polygons regardless of any scale change to the sofa or floor. Bisecting by removing walls/floor/sofa one at a time proved the artifact wasn't any of those nodes — it was SceneKit's own auto-framing default camera, because view.pointOfView was never set to the manually positioned cameraNode. Without it, the camera placed in the code (0, 2, 1.7 looking at 0, 0.3, -0.5) was never actually used for rendering. Confirmed via screenshot: with pointOfView set, the scene renders as a wall/floor plane with the sofa visible as a separate object, instead of one giant unrecognizable polygon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
검증
후속 보완