Fixed collision listener bug & incorrect transform forward. Added collision tags to raycasts. #274
|
@ -74,7 +74,9 @@ namespace Sandbox
|
|||
SHSystemManager::CreateSystem<SHScriptEngine>();
|
||||
SHSystemManager::CreateSystem<SHTransformSystem>();
|
||||
SHSystemManager::CreateSystem<SHPhysicsSystem>();
|
||||
#ifndef _PUBLISH
|
||||
SHSystemManager::CreateSystem<SHPhysicsDebugDrawSystem>();
|
||||
#endif
|
||||
|
||||
SHSystemManager::CreateSystem<SHAudioSystem>();
|
||||
SHSystemManager::CreateSystem<SHCameraSystem>();
|
||||
|
@ -114,7 +116,9 @@ namespace Sandbox
|
|||
SHSystemManager::RegisterRoutine<SHPhysicsSystem, SHPhysicsSystem::PhysicsFixedUpdate>();
|
||||
SHSystemManager::RegisterRoutine<SHPhysicsSystem, SHPhysicsSystem::PhysicsPostUpdate>();
|
||||
|
||||
#ifndef _PUBLISH
|
||||
SHSystemManager::RegisterRoutine<SHPhysicsDebugDrawSystem, SHPhysicsDebugDrawSystem::PhysicsDebugDrawRoutine>();
|
||||
#endif
|
||||
|
||||
SHSystemManager::RegisterRoutine<SHTransformSystem, SHTransformSystem::TransformPostPhysicsUpdate>();
|
||||
SHSystemManager::RegisterRoutine<SHDebugDrawSystem, SHDebugDrawSystem::ProcessPointsRoutine>();
|
||||
|
@ -189,6 +193,13 @@ namespace Sandbox
|
|||
SHSystemManager::RunRoutines(false, SHFrameRateController::GetRawDeltaTime());
|
||||
#endif
|
||||
// TODO: Move into an Editor menu
|
||||
static bool drawContacts = false;
|
||||
if (SHInputManager::GetKeyDown(SHInputManager::SH_KEYCODE::F9))
|
||||
{
|
||||
drawContacts = !drawContacts;
|
||||
SHSystemManager::GetSystem<SHPhysicsDebugDrawSystem>()->SetDebugDrawFlag(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACT_POINTS, drawContacts);
|
||||
SHSystemManager::GetSystem<SHPhysicsDebugDrawSystem>()->SetDebugDrawFlag(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACT_NORMALS, drawContacts);
|
||||
}
|
||||
static bool drawColliders = false;
|
||||
if (SHInputManager::GetKeyDown(SHInputManager::SH_KEYCODE::F10))
|
||||
{
|
||||
|
@ -201,13 +212,7 @@ namespace Sandbox
|
|||
drawRays = !drawRays;
|
||||
SHSystemManager::GetSystem<SHPhysicsDebugDrawSystem>()->SetDebugDrawFlag(SHPhysicsDebugDrawSystem::DebugDrawFlags::RAYCASTS, drawRays);
|
||||
}
|
||||
static bool drawContacts = false;
|
||||
if (SHInputManager::GetKeyDown(SHInputManager::SH_KEYCODE::F9))
|
||||
{
|
||||
drawContacts = !drawContacts;
|
||||
SHSystemManager::GetSystem<SHPhysicsDebugDrawSystem>()->SetDebugDrawFlag(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACT_POINTS, drawContacts);
|
||||
SHSystemManager::GetSystem<SHPhysicsDebugDrawSystem>()->SetDebugDrawFlag(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACT_NORMALS, drawContacts);
|
||||
}
|
||||
|
||||
}
|
||||
// Finish all graphics jobs first
|
||||
graphicsSystem->AwaitGraphicsExecution();
|
||||
|
|
|
@ -173,7 +173,11 @@ namespace SHADE
|
|||
}
|
||||
|
||||
worldState.CreateWorld(factory);
|
||||
#ifdef _PUBLISH
|
||||
worldState.world->setIsDebugRenderingEnabled(false);
|
||||
#else
|
||||
worldState.world->setIsDebugRenderingEnabled(true);
|
||||
#endif
|
||||
|
||||
// Link Collision Listener & Raycaster
|
||||
collisionListener.BindToWorld(worldState.world);
|
||||
|
@ -438,7 +442,11 @@ namespace SHADE
|
|||
return onPlayEvent->handle;
|
||||
|
||||
worldState.CreateWorld(factory);
|
||||
#ifdef _PUBLISH
|
||||
worldState.world->setIsDebugRenderingEnabled(false);
|
||||
#else
|
||||
worldState.world->setIsDebugRenderingEnabled(true);
|
||||
#endif
|
||||
|
||||
// Link Collision Listener & Raycaster
|
||||
collisionListener.BindToWorld(worldState.world);
|
||||
|
|
Loading…
Reference in New Issue