#ifndef CPHYSICSBODYMODIFIER_H
#define CPHYSICSBODYMODIFIER_H

#include "PhysicsGlobal.h"

class IPhysicsBodyModifier
{
public:
	IPhysicsBodyModifier();
	~IPhysicsBodyModifier();

	void setTransformCallback(NewtonSetTransform callback);
	void setAutoactiveCallback(NewtonBodyActivationState callback);
	void setForceAndTorqueCallback(NewtonApplyForceAndTorque callback);
	void setDestructorCallback(NewtonBodyDestructor callback);
	NewtonApplyForceAndTorque getForceAndTorqueCallback();


	void setMassMatrix(f32 mass, vector3df inertia);
	f32 getMass();
	f32 getInvMass();
	vector3df getInertia();
	vector3df getInvInertia();

	void setMatrix(matrix4 matrix);
	matrix4 getMatrix();

	void setCenterOfMass(vector3df center);
	vector3df getCenterOfMass();

	void setMatrixRecursive(matrix4 matrix);

	void setForce(vector3df force);
	void addForce(vector3df force);
	vector3df getForce();

	void setTorque(vector3df torque);
	void addTorque(vector3df torque);
	vector3df getTorque();
	
	void setCollision(NewtonCollision* collision);
	NewtonCollision* getCollision();

	void enableCoriolisForcesMode(bool mode);

	NewtonWorld* getWorld();

	void setMaterial(int material);
	int getMaterial();

	void setContinuousCollisionMode(bool state);
	bool getContinuousCollisionMode();

	void setJointRecursiveCollision(bool state);
	bool getJointRecursiveCollision();

	void setAutofreeze(bool state);
	bool getAutofreeze();

	bool getSleepingState();
	
	void setFreezeTreshold(f32 freezeSpeed, f32 freezeOmega, int framesCount);
	f32 getFreezeSpeed();
	f32 getFreezeOmega();
	
	aabbox3d<f32> getAABB();

	void setVelocity(vector3df velocity);
	vector3df getVelocity();

	void setOmega(vector3df omega);
	vector3df getOmega();

	void setLinearDamping(f32 linearDamp);
	f32 getLinearDamping();

	void setAngularDamping(vector3df angularDamp);
	vector3df getAngularDamping();

	void forEachPolygonDo(NewtonCollisionIterator callback);

	void addBodyImpulse(vector3df pointDeltaVeloc, vector3df pointPosit);

	vector3df forceAdd;
	vector3df forceSet;

	vector3df torqueAdd;
	vector3df torqueSet;

protected:
	NewtonBody* m_body;
};

#endif