/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
------------------------------------------------------------------------------*/


#ifndef	__NPHYSIC_MATERIAL__
#define	__NPHYSIC_MATERIAL__


namespace GS {
	namespace NML { class Tag; }
	namespace Core {

/*!
	@short	Physic material.
	@author Emmanuel Julien (ejulien@gsworks.fr)
*/
struct	PhysicMaterial
{
/*!
	@name	General physic properties.
	@{
*/
		float		mass;					///< Mass.
		float		dynamic_friction;		///< Dynamic friction.
		float		static_friction;		///< Static friction.
		float		restitution;			///< Restitution (inelastic/elastic).

		bool		anisotropic_friction;	///< Anisotropic friction.
		float		v_dynamic_friction;		///< Lateral dynamic friction.
		float		v_static_friction;		///< Lateral static friction.

		/*!
			@short	Set material friction.

			@note	The static friction is a force opposing external forces
					acting on a resting body. The dynamic friction is a force
					opposing the motion of a moving body.
			@see	SetAnisotropicFriction().
		*/
		void		SetFriction(float dync = 0.5f, float sttc = 0.75f)
		{	dynamic_friction = dync; static_friction = sttc;	}
/// @}

/*!
	@name	Soft body properties.
	@{
*/
		float		sb_damping;				///< Damping.
		float		sb_stiffness;			///< Stiffness.
		float		sb_torsion;				///< Torsion.
/// @}

		bool		FromMetaTag(NML::Tag &);
		NML::Tag	*AsMetaTag() const;

		PhysicMaterial();
virtual ~PhysicMaterial(){}
};

	} // Core
} // GS


#endif	// __NPHYSIC_MATERIAL__
