Revamped collision system

This commit is contained in:
Jan Racek
2026-03-27 16:39:42 +01:00
parent d29ef569b3
commit 1c48b8b425
16 changed files with 318 additions and 136 deletions

View File

@@ -58,6 +58,7 @@ namespace SplashEdit.RuntimeCode
// Component arrays
private PSXInteractable[] _interactables;
private PSXAudioSource[] _audioSources;
private PSXTriggerBox[] _triggerBoxes;
// Phase 3+4: World collision and nav regions
private PSXCollisionExporter _collisionExporter;
@@ -120,6 +121,7 @@ namespace SplashEdit.RuntimeCode
// Collect components
_interactables = FindObjectsByType<PSXInteractable>(FindObjectsSortMode.None);
_audioSources = FindObjectsByType<PSXAudioSource>(FindObjectsSortMode.None);
_triggerBoxes = FindObjectsByType<PSXTriggerBox>(FindObjectsSortMode.None);
// Collect UI image textures for VRAM packing alongside 3D textures
PSXUIImage[] uiImages = FindObjectsByType<PSXUIImage>(FindObjectsSortMode.None);
@@ -164,7 +166,7 @@ namespace SplashEdit.RuntimeCode
_collisionExporter = new PSXCollisionExporter();
_collisionExporter.Build(_exporters, GTEScaling);
if (_collisionExporter.MeshCount == 0)
Debug.LogWarning("No collision meshes! Set CollisionType=Solid on your floor/wall objects.");
Debug.LogWarning("No collision meshes! Set CollisionType=Static on your floor/wall objects.");
// Phase 4+5: Room volumes are needed by BOTH the nav region builder
// (for spatial room assignment) and the room builder (for triangle assignment).
@@ -295,6 +297,7 @@ namespace SplashEdit.RuntimeCode
audioSources = _audioSources,
canvases = _canvases,
fonts = _fonts,
triggerBoxes = _triggerBoxes,
};
PSXSceneWriter.Write(path, in scene, (msg, type) =>