Added triggers and targetting system for brushes. Added corresponding Scripting API endpoint for accessing those.

This commit is contained in:
Antoine Pilote
2021-06-27 22:27:57 -04:00
parent 8f4c5f8b08
commit fcdeff9d99
13 changed files with 454 additions and 119 deletions

View File

@@ -51,7 +51,7 @@ namespace Physics
void DynamicWorld::AddGhostbody(Ref<GhostObject> gb)
{
dynamicsWorld->addCollisionObject(gb->GetBulletObject(), btBroadphaseProxy::KinematicFilter, btBroadphaseProxy::StaticFilter);
dynamicsWorld->addCollisionObject(gb->GetBulletObject(), btBroadphaseProxy::SensorTrigger, btBroadphaseProxy::KinematicFilter);
}
void DynamicWorld::AddCharacterController(Ref<CharacterController> cc)
@@ -59,7 +59,7 @@ namespace Physics
dynamicsWorld->addRigidBody(cc->m_Rigidbody);
// Specify filters manually, otherwise ghost doesn't collide with statics for some reason
dynamicsWorld->addCollisionObject(cc->m_GhostObject, btBroadphaseProxy::KinematicFilter, btBroadphaseProxy::StaticFilter );
dynamicsWorld->addCollisionObject(cc->m_GhostObject, btBroadphaseProxy::KinematicFilter, btBroadphaseProxy::SensorTrigger | btBroadphaseProxy::StaticFilter );
}