feat(physics): simple and phantom physics objects register as movement blockers

A fixed simple physics object, or a phantom volume, that its data marks as a
wall for enemies (a navmesh carver, or solid with a group only enemies touch)
adds its shape to the world's movement blockers, and takes it out again when it
goes away. Only shapes the server knows are used; an unknown asset's stand in
cube would be a guess, so it is logged and left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 17:37:45 -05:00
parent 425b913848
commit 62f5f13846
4 changed files with 56 additions and 3 deletions

View File

@@ -33,6 +33,9 @@ SimplePhysicsComponent::SimplePhysicsComponent(Entity* parent, const int32_t com
}
// Without a motionType the object is fixed (live: Fixed on 38,970 of 40,786 constructions, never the invalid 0)
if (m_Parent->HasVar(u"motionType")) m_PhysicsMotionState = m_Parent->GetVarAs<uint32_t>(u"motionType");
// A fixed solid object can be a wall enemies walk into (an enemy only blocker, or a navmesh carver)
if (m_PhysicsMotionState == MOTION_TYPE_FIXED) RegisterMovementBlocker(eReplicaComponentType::SIMPLE_PHYSICS, true, m_Parent->GetDefaultScale());
}
SimplePhysicsComponent::~SimplePhysicsComponent() {