Project

General

Profile

SO3Engine
OgreNewt_MaterialPair.h
Go to the documentation of this file.
1/*
2 OgreNewt Library
3
4 Ogre implementation of Newton Game Dynamics SDK
5
6 OgreNewt basically has no license, you may use any or all of the library however you desire... I hope it can help you in any way.
7
8 by Walaber
9 some changes by melven
10
11*/
12#ifndef _INCLUDE_OGRENEWT_MATERIALPAIR
13#define _INCLUDE_OGRENEWT_MATERIALPAIR
14
15
17#include "OgreNewt_World.h"
19#include "OgreNewt_MaterialID.h"
20
21// OgreNewt namespace. all functions and classes use this namespace.
22namespace OgreNewt
23{
24
25
27
31class _OgreNewtExport MaterialPair
32{
33public:
34
36
42 MaterialPair( const World* world, const MaterialID* mat1, const MaterialID* mat2 );
43
46
47
48 // set the default behavior for this material pair.
49
51 void setDefaultSoftness( Ogre::Real softness ) const { NewtonMaterialSetDefaultSoftness( m_world->getNewtonWorld(), id0->getID(), id1->getID(), (float)softness ); }
52
54 void setDefaultElasticity( Ogre::Real elasticity ) const { NewtonMaterialSetDefaultElasticity( m_world->getNewtonWorld(), id0->getID(), id1->getID(), (float)elasticity ); }
55
57 void setDefaultCollidable( int state ) const { NewtonMaterialSetDefaultCollidable( m_world->getNewtonWorld(), id0->getID(), id1->getID(), state ); }
58
60 void setDefaultSurfaceThickness( float thickness ) const { NewtonMaterialSetSurfaceThickness( m_world->getNewtonWorld(), id0->getID(), id1->getID(), thickness ); }
61
63 void setDefaultFriction( Ogre::Real stat, Ogre::Real kinetic ) const { NewtonMaterialSetDefaultFriction( m_world->getNewtonWorld(), id0->getID(), id1->getID(), (float)stat, (float)kinetic ); }
64
66
70 void setContactCallback( OgreNewt::ContactCallback* callback );
71
72
73protected:
76 const World* m_world;
78
79private:
81 static int _CDECL collisionCallback_onAABBOverlap( const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1, int threadIndex );
83 static void _CDECL collisionCallback_contactsProcess(const NewtonJoint* contact, dFloat timeStep, int threadIndex );
84
85
86};
87
88
89} // end NAMESPACE OgreNewt
90
91#endif
92// _INCLUDE_OGRENEWT_MATERIALPAIR
93
represents a material
define interaction between materials
void setDefaultSoftness(Ogre::Real softness) const
set default softness for the material pair.
void setDefaultCollidable(int state) const
set default collision for the material pair.
void setDefaultElasticity(Ogre::Real elasticity) const
set default elasticity for the material pair.
void setDefaultSurfaceThickness(float thickness) const
set the default thickness for this material pair
void setDefaultFriction(Ogre::Real stat, Ogre::Real kinetic) const
set default friction for the material pair.
OgreNewt::ContactCallback * m_contactcallback
represents a physics world.