/*
   core/physics.h
   This file is part of the Osirion project and is distributed under
   the terms and conditions of the GNU General Public License version 2
*/

#ifndef __INCLUDED_CORE_PHYSICS_H__
#define __INCLUDED_CORE_PHYSICS_H__

#include "sys/sys.h"
#include "math/vector3f.h"
#include "math/axis.h"
#include "core/cvar.h"
#include "model/collisionmesh.h"

#include "btBulletDynamicsCommon.h"
#include "BulletCollision/CollisionShapes/btTriangleMesh.h"
#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
#include "BulletCollision/Gimpact/btGImpactShape.h"
#include "BulletDynamics/Dynamics/btActionInterface.h"

namespace core
{

class Physics {
public:
	static void init();
	
	static void done();
	
	static void frame(const unsigned long elapsed);

	inline static btDefaultCollisionConfiguration *configuration() {
		return physics_configuration;
	}
	
	inline static btCollisionDispatcher *dispatcher() {
		return physics_dispatcher;
	}
	
	inline static btSequentialImpulseConstraintSolver *solver() {
		return physics_solver;
	}

private:
	static btDefaultCollisionConfiguration 		*physics_configuration;
	static btCollisionDispatcher 			*physics_dispatcher;
	static btSequentialImpulseConstraintSolver	*physics_solver;
};

} // namespace core

#endif // __INCLUDED_CORE_PHYSICS_H__