From a3cc6eb73f3c868a6d7f1c2dfd341e1b28dde746 Mon Sep 17 00:00:00 2001 From: Otto Naderer Date: Mon, 5 May 2014 00:45:50 +0200 Subject: [PATCH] extended doxy --- include/irrDynamics.h | 11 ++++++++++- src/irrDynamics.cpp | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/irrDynamics.h b/include/irrDynamics.h index a10069c..d56d026 100644 --- a/include/irrDynamics.h +++ b/include/irrDynamics.h @@ -26,7 +26,16 @@ class irrDynamics { public: static irrDynamics* getInstance(); - static void simStep(const irr::u32& curTimeStamp); + //! Update the physics + /** This method calculates all the changes in the physics world. Forces are + * applied, constraints resolved and collisions treated. It is hence recommendable + * to call this method prior to drawing the next frame. + * \note If you don't call this method, nothing's gonna happen/move. + * \param curTimeStamp The current timestamp in milliseconds. Use ITimer::getRealTime() or anything similar.*/ + static void simStep(irr::u32 curTimeStamp); + //! Terminate physics and free resources + /** Once done with simulating physics, this method removes all bullet representations of your scene nodes, + * constraints and the entire sim world. Suitable to be called when your application exits.*/ static void shutdown(); static void addTerrain(irr::scene::ITerrainSceneNode* terrain, irr::u32 lodLevel = 2); //! Add a scene node that is represented as spherical behavior diff --git a/src/irrDynamics.cpp b/src/irrDynamics.cpp index f89204b..26817af 100644 --- a/src/irrDynamics.cpp +++ b/src/irrDynamics.cpp @@ -46,7 +46,7 @@ irrDynamics* irrDynamics::getInstance() return instance; } -void irrDynamics::simStep(const u32& curTimeStamp) +void irrDynamics::simStep(u32 curTimeStamp) { irrDynamics* inst = getInstance(); if (inst->lastStep == 0) @@ -66,6 +66,7 @@ void irrDynamics::shutdown() delete inst->dispatcher; delete inst->broadPhase; delete inst->collisionConfiguration; + instance = 0; } void irrDynamics::addTerrain(scene::ITerrainSceneNode* terrain, u32 lodLevel)