#ifndef IMATERIAL_CALLBACK_H
#define IMATERIAL_CALLBACK_H

#include "PhysicsGlobal.h"

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

	void disableContact(bool disable);
	unsigned getContactFaceAttribute();
	f32 getTimeStep();
	f32 getContactNormalSpeed();
	f32 getContactTangentSpeed(int tangentIndex);
	vector3df getContactPosition();
	vector3df getContactNormal();
	vector3df getContactForce();
	vector3df getContactPrimaryTangent();
	vector3df getContactSecondaryTangent();
	int getBodyCollisionID();

	void setContactSoftneess(f32 softness);
	void setContactElasticity(f32 elasticity);
	void setContactFriction(bool friction, int tangentIndex);
	void setContactStaticFriction(f32 staticFriction, int tangentIndex);
	void setContactKineticFriction(f32 kineticFriction, int tangentIndex);
	void setContactNormalAcceleration(f32 accel);
	void setContactNormalDirection(vector3df dir);
	void setContactTangentAcceleration(f32 accel, int tangentIndex);
	void contactRotateTangentDirections(vector3df alignVector);

	/// User Callbacks
	virtual int beginCallback()  { return 1; };
	virtual int processCalback()  { return 1; };
	virtual void endCallback()  { };

	/// Newton Callbacks
	static int _cdecl beginContact (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1);
	static int _cdecl processContact (const NewtonMaterial* material, const NewtonContact* contact);
	static void _cdecl endContact (const NewtonMaterial* material);


private:
	NewtonMaterial* m_material;
	NewtonContact* m_contact;

	NewtonBody* m_body0;
	NewtonBody* m_body1;

};

#endif;