SO3Engine
|
OgreNewt_ContactJoint.h
Go to the documentation of this file.
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.
49 OgreNewt::Body* getBody0() { return (OgreNewt::Body*) NewtonBodyGetUserData(NewtonJointGetBody0(m_contactjoint)); }
52 OgreNewt::Body* getBody1() { return (OgreNewt::Body*) NewtonBodyGetUserData(NewtonJointGetBody1(m_contactjoint)); }
93 // basic contact control commands... they can only be used, if this is a valid contact ( !contact == false )
96 OgreNewt::Body* getBody0() const { return (OgreNewt::Body*) NewtonBodyGetUserData( NewtonJointGetBody0( m_parent->_getNewtonContactJoint() ) ); }
97 OgreNewt::Body* getBody1() const { return (OgreNewt::Body*) NewtonBodyGetUserData( NewtonJointGetBody1( m_parent->_getNewtonContactJoint() ) ); }
100 unsigned getFaceAttribute() const { return NewtonMaterialGetContactFaceAttribute( m_material ); }
103 //unsigned getBodyCollisionID( OgreNewt::Body* body ) const { return NewtonMaterialGetBodyCollisionID( m_material, body->getNewtonBody() ); }
106 Ogre::Real getNormalSpeed() const { return (Ogre::Real)NewtonMaterialGetContactNormalSpeed( m_material ); }
115 void getPositionAndNormal( Ogre::Vector3& pos, Ogre::Vector3& norm, OgreNewt::Body* body ) const
119 NewtonMaterialGetContactPositionAndNormal(m_material, body->getNewtonBody(), &fPos.m_x, &fNorm.m_x);
131 void getTangentDirections( Ogre::Vector3& dir0, Ogre::Vector3& dir1, OgreNewt::Body* body ) const
136 NewtonMaterialGetContactTangentDirections(m_material, body->getNewtonBody(), &fDir0.m_x, &fDir1.m_x);
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 ); }
189 void setNormalAcceleration( Ogre::Real accel ) { NewtonMaterialSetContactNormalAcceleration( m_material, dFloat(accel)); }
NewtonBody * getNewtonBody() const
get a pointer to the NewtonBody object
Definition OgreNewt_Body.h:127
with the methods from this class you can set the behavior of each contac-point
Definition OgreNewt_ContactJoint.h:78
void setElasticity(Ogre::Real elasticity)
set elasticity of the current contact
Definition OgreNewt_ContactJoint.h:157
NewtonMaterial * _getNewtonMaterial()
get the NewtonMaterial from this callback.
Definition OgreNewt_ContactJoint.h:199
void setNormalAcceleration(Ogre::Real accel)
manually set the acceleration along the collision normal.
Definition OgreNewt_ContactJoint.h:189
void rotateTangentDirections(const Ogre::Vector3 &dir)
align tangent vectors with a user supplied direction
Definition OgreNewt_ContactJoint.h:169
void setFrictionState(int state, int index)
set friction state of current contact
Definition OgreNewt_ContactJoint.h:160
void setFrictionCoef(Ogre::Real stat, Ogre::Real kinetic, int index)
set static friction for current contact
Definition OgreNewt_ContactJoint.h:163
Ogre::Real getNormalSpeed() const
get the Collision ID of a body currently colliding
Definition OgreNewt_ContactJoint.h:106
unsigned getFaceAttribute() const
get the face ID of a TreeCollision object
Definition OgreNewt_ContactJoint.h:100
void setSoftness(Ogre::Real softness)
set softness of the current contact
Definition OgreNewt_ContactJoint.h:154
void getTangentDirections(Ogre::Vector3 &dir0, Ogre::Vector3 &dir1, OgreNewt::Body *body) const
get the tangent vectors of the collision
Definition OgreNewt_ContactJoint.h:131
void getPositionAndNormal(Ogre::Vector3 &pos, Ogre::Vector3 &norm, OgreNewt::Body *body) const
get positoin and normal of the collision
Definition OgreNewt_ContactJoint.h:115
Ogre::Real getTangentSpeed(int index) const
get tangent speed of the collision
Definition OgreNewt_ContactJoint.h:148
void setTangentAcceleration(Ogre::Real accel, int index)
set tangent acceleration for contact
Definition OgreNewt_ContactJoint.h:166
void setNormalDirection(const Ogre::Vector3 &dir)
manually set the normal for the collision.
Definition OgreNewt_ContactJoint.h:179
with this class you can iterate through all contacts
Definition OgreNewt_ContactJoint.h:33
const NewtonJoint * _getNewtonContactJoint()
get the newton ContactJoint
Definition OgreNewt_ContactJoint.h:55
const NewtonJoint * m_contactjoint
Definition OgreNewt_ContactJoint.h:64
Generated by 1.9.8