Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/physics.cc')
-rw-r--r--src/core/physics.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/physics.cc b/src/core/physics.cc
index 4dadf07..6969b06 100644
--- a/src/core/physics.cc
+++ b/src/core/physics.cc
@@ -4,19 +4,22 @@
the terms and conditions of the GNU General Public License version 2
*/
+#include "model/collisionmesh.h"
#include "core/physics.h"
#include "core/zone.h"
namespace core {
-btDefaultCollisionConfiguration *Physics::physics_configuration;
-btCollisionDispatcher *Physics::physics_dispatcher;
-btSequentialImpulseConstraintSolver *Physics::physics_solver;
-unsigned long Physics::physics_timestamp;
+btDefaultCollisionConfiguration *Physics::physics_configuration = 0;
+btCollisionDispatcher *Physics::physics_dispatcher = 0;
+btSequentialImpulseConstraintSolver *Physics::physics_solver = 0;
+unsigned long Physics::physics_timestamp = 0;
void Physics::init()
{
con_print << "^BInitializing physics engine..." << std::endl;
+
+ model::CollisionMesh::init();
physics_configuration = new btDefaultCollisionConfiguration();
physics_dispatcher = new btCollisionDispatcher(physics_configuration);
@@ -27,7 +30,10 @@ void Physics::init()
void Physics::done()
{
- con_print << "^Bshutting down physics engine..." << std::endl;
+ con_print << "^BShutting down physics engine..." << std::endl;
+
+ model::CollisionMesh::shutdown();
+
delete physics_solver;
delete physics_dispatcher;
delete physics_configuration;