Compose source body physics and enable tutorial static response

This commit is contained in:
UnixNight committed 2026-10-26 22:22:42 -04:00
1 parent df0263b26e
commit 35a2a66606
26 files changed
+1045 -18

No files matched your search

+9 -3
View File
@@ -325,7 +325,8 @@ internal static class Program
debugCameraRay = cameraRay;
simulation = new LabSimulation(new SceneCollision(world), standingPose, originalStart.Position, originalStart.Rotation.Y,
cameraRay == null ? null : (look, eye) => cameraRay.Trace(look, eye),
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end))
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end),
level.Code == "VR04" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null)
{ LevelCode = level.Code, InputAfterPlayerUpdate = carriedSave != null };
if (carriedPlayer != null)
{
@@ -396,8 +397,13 @@ internal static class Program
mesh = spriteVisuals.Mesh;
staticVisuals = new StaticSceneVisuals(mesh, director, root, Path.Combine(Path.GetDirectoryName(scene!)!, "models"));
mesh = staticVisuals.Mesh;
simulation!.DynamicRootResolver = (previous, position, radius) =>
DynamicBodyResponse.Resolve(staticVisuals.DoorColliders(), previous, position, radius);
if (simulation!.UsesOriginalBody)
{
if (staticVisuals.DoorColliders().Any())
throw new NotSupportedException("Source ordinary-body scene has unsupported dynamic door colliders");
}
else simulation.DynamicRootResolver = (previous, position, radius) =>
DynamicBodyResponse.Resolve(staticVisuals.DoorColliders(), previous, position, radius);
jetpackVisuals = new JetpackVisuals(mesh, Path.GetFullPath(Path.Combine(Path.GetDirectoryName(scene!)!, "..")));
mesh = jetpackVisuals.Mesh;
hud = new SceneHud(mesh, Path.Combine(Path.GetDirectoryName(scene!)!, "../ui/ui.json"));