
#pragma once
#pragma unmanaged
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
#pragma managed
#include "BulletCollision/BroadphaseCollision/IDispatcher.h"
#include "BulletCollision/BroadphaseCollision/IBroadphaseInterface.h"
#include "BulletDynamics/ConstraintSolver/IConstraintSolver.h"
#include "BulletDynamics/ConstraintSolver/Generic6DofSpringConstraint.h"
#include "BulletCollision/CollisionDispatch/ICollisionConfiguration.h"
#include "RigidBody.h"

using namespace System;
using namespace Microsoft::Xna::Framework;
using namespace System::Collections::Generic;

namespace BulletCLI
{

	public ref class DiscreteDynamicsWorld
	{
	private:
		btDiscreteDynamicsWorld* m_p;
    public:
		DiscreteDynamicsWorld(IDispatcher^ dispatcher,IBroadphaseInterface^ pairChache,
                    IConstraintSolver^ constraintSolver,ICollisionConfiguration^ collisionConfiguration);
		virtual ~DiscreteDynamicsWorld();
		!DiscreteDynamicsWorld();
        
        void SetGravity(float x,float y, float z);
        void StepSimulation(float timeStep, int maxSubSteps);
        void AddRigidBody(RigidBody^ body,short group,short mask);
        void AddConstraint(Generic6DofSpringConstraint^ constraint);
    };
}