10#ifndef DVD_PHYSICS_API_FOUND_
11#error "No physics library implemented!"
24 ,
FrameListener(
"PXDevice", context.kernel().frameListenerMgr(), 2u )
36 "PXDevice error: initPhysicsAPI called twice!" );
57 if (
_api ==
nullptr )
63 const bool state =
_api->closePhysicsAPI();
72 _api->updateTimeStep( timeStepFactor, simSpeed );
79 frameEnded( evt._time._game._deltaTimeUS );
85 _api->frameEnded( deltaTimeGameUS );
98 _api->frameStarted( deltaTimeGameUS );
110 return _api->initPhysicsScene( scene );
115 return _api->destroyPhysicsScene( scene );
121 return _api->createRigidActor( node, parentComp );
127 return _api->convertActor( actor, newGroup );
133 return _api->intersect( intersectionRay, range, intersectionsOut );
#define PROFILE_SCOPE_AUTO(CATEGORY)
void updateTimeStep(U8 timeStepFactor, F32 simSpeed) override
ErrorCode initPhysicsAPI(U8 targetFrameRate, F32 simSpeed) override
bool initPhysicsScene(Scene &scene) override
PhysicsAPIWrapper_uptr _api
bool destroyPhysicsScene(const Scene &scene) override
bool intersect(const Ray &intersectionRay, vec2< F32 > range, vector< SGNRayResult > &intersectionsOut) const override
bool frameStarted(const FrameEvent &evt) override
bool closePhysicsAPI() override
PhysicsAsset * createRigidActor(SceneGraphNode *node, RigidBodyComponent &parentComp) override
bool convertActor(PhysicsAsset *actor, PhysicsGroup newGroup) override
bool frameEnded(const FrameEvent &evt) noexcept override
frameEnded is called after the buffers have been swapped
PlatformContext & _context
constexpr Optick::Category::Type Physics
constexpr F32 g_maxSimSpeed
Handle console commands that start with a forward slash.
eastl::vector< Type > vector
::value constexpr T CLAMPED(T n, T min, T max) noexcept
static NO_INLINE void errorfn(const char *format, T &&... args)
static NO_INLINE void printfn(const char *format, T &&... args)
struct Divide::FrameEvent::Time::Impl _game
struct Divide::FrameEvent::Time _time