From a440cffb0e07a7253223ad45b5f6710894010c1a Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Fri, 20 Dec 2013 11:43:12 +0100 Subject: [PATCH] Added function to get delta time Now in local physics API --- Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp | 5 +++++ Code/GamePhysics/Implementation/PhysicsAPI_Impl.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp index 86e5038f..85f484a8 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp @@ -117,6 +117,11 @@ void API_Impl::SetSubscription( API::EventAction_Destruction functionPointer ) } } +float API_Impl::GetFrameTimeLength() const +{ + return this->updateFrameLength; +} + void API_Impl::Update() { /** @todo TODO: Update is a temporary solution .*/ diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h index d10d067a..0c08bf11 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h @@ -20,6 +20,8 @@ namespace Oyster void SetGravityConstant( float g ); void SetSubscription( EventAction_Destruction functionPointer ); + float GetFrameTimeLength() const; + void Update(); bool IsInLimbo( const ICustomBody* objRef );