12#ifndef _INCLUDE_OGRENEWT_CONTACTJOINT
13#define _INCLUDE_OGRENEWT_CONTACTJOINT
43 int getContactCount()
const {
return NewtonContactJointGetContactCount( m_contactjoint ); }
88 operator bool()
const {
return m_contact != NULL; }
100 unsigned getFaceAttribute()
const {
return NewtonMaterialGetContactFaceAttribute( m_material ); }
106 Ogre::Real
getNormalSpeed()
const {
return (Ogre::Real)NewtonMaterialGetContactNormalSpeed( m_material ); }
112 Ogre::Vector3 getForce()
const;
119 NewtonMaterialGetContactPositionAndNormal(m_material, body->
getNewtonBody(), &fPos.m_x, &fNorm.m_x);
121 pos.x = Ogre::Real(fPos.m_x);
122 pos.y = Ogre::Real(fPos.m_y);
123 pos.z = Ogre::Real(fPos.m_z);
125 norm.x = Ogre::Real(fNorm.m_x);
126 norm.y = Ogre::Real(fNorm.m_y);
127 norm.z = Ogre::Real(fNorm.m_z);
136 NewtonMaterialGetContactTangentDirections(m_material, body->
getNewtonBody(), &fDir0.m_x, &fDir1.m_x);
138 dir0.x = Ogre::Real(fDir0.m_x);
139 dir0.y = Ogre::Real(fDir0.m_y);
140 dir0.z = Ogre::Real(fDir0.m_z);
142 dir1.x = Ogre::Real(fDir1.m_x);
143 dir1.y = Ogre::Real(fDir1.m_y);
144 dir1.z = Ogre::Real(fDir1.m_z);
150 return (Ogre::Real)NewtonMaterialGetContactTangentSpeed( m_material, index );
154 void setSoftness( Ogre::Real softness ) { NewtonMaterialSetContactSoftness( m_material, dFloat(softness)); }
157 void setElasticity( Ogre::Real elasticity ) { NewtonMaterialSetContactElasticity( m_material, dFloat(elasticity)); }
160 void setFrictionState(
int state,
int index ) { NewtonMaterialSetContactFrictionState( m_material, state, index ); }
163 void setFrictionCoef( Ogre::Real stat, Ogre::Real kinetic,
int index ) { NewtonMaterialSetContactFrictionCoef( m_material, dFloat(stat), dFloat(kinetic), index ); }
166 void setTangentAcceleration( Ogre::Real accel,
int index ) { NewtonMaterialSetContactTangentAcceleration( m_material, dFloat(accel), index ); }
172 fdir.m_x = dFloat(dir.x);
173 fdir.m_y = dFloat(dir.y);
174 fdir.m_z = dFloat(dir.z);
175 NewtonMaterialContactRotateTangentDirections( m_material, &fdir.m_x);
182 fdir.m_x = dFloat(dir.x);
183 fdir.m_y = dFloat(dir.y);
184 fdir.m_z = dFloat(dir.z);
185 NewtonMaterialSetContactNormalDirection( m_material, &fdir.m_x);
189 void setNormalAcceleration( Ogre::Real accel ) { NewtonMaterialSetContactNormalAcceleration( m_material, dFloat(accel)); }
main class for all Rigid Bodies in the system.
NewtonBody * getNewtonBody() const
get a pointer to the NewtonBody object
define interaction between materials