Project

General

Profile

SO3Engine
OgreNewt::Contact Class Reference

with the methods from this class you can set the behavior of each contac-point More...

#include <OgreNewt_ContactJoint.h>

Public Member Functions

 Contact (void *contact, ContactJoint *parent)
 constructor
 
 ~Contact ()
 destructor
 
 operator bool () const
 return true, if this is not a valid contact (end of the contact-list!)
 
Contact getNext () const
 get the next contact from the parent contact-joint
 
OgreNewt::BodygetBody0 () const
 get the first body
 
OgreNewt::BodygetBody1 () const
 
unsigned getFaceAttribute () const
 get the face ID of a TreeCollision object
 
Ogre::Real getNormalSpeed () const
 get the Collision ID of a body currently colliding
 
Ogre::Vector3 getForce () const
 force of the collision
 
void getPositionAndNormal (Ogre::Vector3 &pos, Ogre::Vector3 &norm, OgreNewt::Body *body) const
 get positoin and normal of the collision
 
void getTangentDirections (Ogre::Vector3 &dir0, Ogre::Vector3 &dir1, OgreNewt::Body *body) const
 get the tangent vectors of the collision
 
Ogre::Real getTangentSpeed (int index) const
 get tangent speed of the collision
 
void setSoftness (Ogre::Real softness)
 set softness of the current contact
 
void setElasticity (Ogre::Real elasticity)
 set elasticity of the current contact
 
void setFrictionState (int state, int index)
 set friction state of current contact
 
void setFrictionCoef (Ogre::Real stat, Ogre::Real kinetic, int index)
 set static friction for current contact
 
void setTangentAcceleration (Ogre::Real accel, int index)
 set tangent acceleration for contact
 
void rotateTangentDirections (const Ogre::Vector3 &dir)
 align tangent vectors with a user supplied direction
 
void setNormalDirection (const Ogre::Vector3 &dir)
 manually set the normal for the collision.
 
void setNormalAcceleration (Ogre::Real accel)
 manually set the acceleration along the collision normal.
 
void remove ()
 removes the contact from the parent contact-joint, this means newton doesn't process this contact
 
NewtonMaterial * _getNewtonMaterial ()
 get the NewtonMaterial from this callback.
 

Protected Attributes

NewtonMaterial * m_material
 
void * m_contact
 
OgreNewt::ContactJointm_parent
 

Detailed Description

with the methods from this class you can set the behavior of each contac-point

this class is for creating custom behavior between material GroupIDs. this class must not be inherited or instantiated directly in any way, you can obtain an object of this class in the contact-callback from the contactJoint and iterate through all contacts using the getNext-function

Definition at line 77 of file OgreNewt_ContactJoint.h.

Constructor & Destructor Documentation

◆ Contact()

OgreNewt::Contact::Contact ( void *  contact,
ContactJoint parent 
)

constructor

Definition at line 39 of file OgreNewt_ContactJoint.cpp.

◆ ~Contact()

OgreNewt::Contact::~Contact ( )

destructor

Definition at line 50 of file OgreNewt_ContactJoint.cpp.

Member Function Documentation

◆ _getNewtonMaterial()

NewtonMaterial * OgreNewt::Contact::_getNewtonMaterial ( )
inline

get the NewtonMaterial from this callback.

Definition at line 199 of file OgreNewt_ContactJoint.h.

◆ getBody0()

OgreNewt::Body * OgreNewt::Contact::getBody0 ( ) const
inline

get the first body

Definition at line 96 of file OgreNewt_ContactJoint.h.

◆ getBody1()

OgreNewt::Body * OgreNewt::Contact::getBody1 ( ) const
inline

Definition at line 97 of file OgreNewt_ContactJoint.h.

◆ getFaceAttribute()

unsigned OgreNewt::Contact::getFaceAttribute ( ) const
inline

get the face ID of a TreeCollision object

Definition at line 100 of file OgreNewt_ContactJoint.h.

◆ getForce()

Ogre::Vector3 OgreNewt::Contact::getForce ( ) const

force of the collision

only valid for objects in a stable state (sitting on top of each other, etc)

Definition at line 60 of file OgreNewt_ContactJoint.cpp.

◆ getNext()

Contact OgreNewt::Contact::getNext ( ) const

get the next contact from the parent contact-joint

Definition at line 54 of file OgreNewt_ContactJoint.cpp.

◆ getNormalSpeed()

Ogre::Real OgreNewt::Contact::getNormalSpeed ( ) const
inline

get the Collision ID of a body currently colliding

speed of the collision

Definition at line 106 of file OgreNewt_ContactJoint.h.

◆ getPositionAndNormal()

void OgreNewt::Contact::getPositionAndNormal ( Ogre::Vector3 &  pos,
Ogre::Vector3 &  norm,
OgreNewt::Body body 
) const
inline

get positoin and normal of the collision

Definition at line 115 of file OgreNewt_ContactJoint.h.

◆ getTangentDirections()

void OgreNewt::Contact::getTangentDirections ( Ogre::Vector3 &  dir0,
Ogre::Vector3 &  dir1,
OgreNewt::Body body 
) const
inline

get the tangent vectors of the collision

Definition at line 131 of file OgreNewt_ContactJoint.h.

◆ getTangentSpeed()

Ogre::Real OgreNewt::Contact::getTangentSpeed ( int  index) const
inline

get tangent speed of the collision

Definition at line 148 of file OgreNewt_ContactJoint.h.

◆ operator bool()

OgreNewt::Contact::operator bool ( ) const
inline

return true, if this is not a valid contact (end of the contact-list!)

Definition at line 88 of file OgreNewt_ContactJoint.h.

◆ remove()

void OgreNewt::Contact::remove ( )

removes the contact from the parent contact-joint, this means newton doesn't process this contact

use this function, when you want to ignore this specific contact, but you need to get the next contact before, because this will invalidate this class (set all pointers to zero!)

Definition at line 67 of file OgreNewt_ContactJoint.cpp.

◆ rotateTangentDirections()

void OgreNewt::Contact::rotateTangentDirections ( const Ogre::Vector3 &  dir)
inline

align tangent vectors with a user supplied direction

Definition at line 169 of file OgreNewt_ContactJoint.h.

◆ setElasticity()

void OgreNewt::Contact::setElasticity ( Ogre::Real  elasticity)
inline

set elasticity of the current contact

Definition at line 157 of file OgreNewt_ContactJoint.h.

◆ setFrictionCoef()

void OgreNewt::Contact::setFrictionCoef ( Ogre::Real  stat,
Ogre::Real  kinetic,
int  index 
)
inline

set static friction for current contact

Definition at line 163 of file OgreNewt_ContactJoint.h.

◆ setFrictionState()

void OgreNewt::Contact::setFrictionState ( int  state,
int  index 
)
inline

set friction state of current contact

Definition at line 160 of file OgreNewt_ContactJoint.h.

◆ setNormalAcceleration()

void OgreNewt::Contact::setNormalAcceleration ( Ogre::Real  accel)
inline

manually set the acceleration along the collision normal.

Definition at line 189 of file OgreNewt_ContactJoint.h.

◆ setNormalDirection()

void OgreNewt::Contact::setNormalDirection ( const Ogre::Vector3 &  dir)
inline

manually set the normal for the collision.

Definition at line 179 of file OgreNewt_ContactJoint.h.

◆ setSoftness()

void OgreNewt::Contact::setSoftness ( Ogre::Real  softness)
inline

set softness of the current contact

Definition at line 154 of file OgreNewt_ContactJoint.h.

◆ setTangentAcceleration()

void OgreNewt::Contact::setTangentAcceleration ( Ogre::Real  accel,
int  index 
)
inline

set tangent acceleration for contact

Definition at line 166 of file OgreNewt_ContactJoint.h.

Member Data Documentation

◆ m_contact

void* OgreNewt::Contact::m_contact
protected

Definition at line 203 of file OgreNewt_ContactJoint.h.

◆ m_material

NewtonMaterial* OgreNewt::Contact::m_material
protected

Definition at line 202 of file OgreNewt_ContactJoint.h.

◆ m_parent

OgreNewt::ContactJoint* OgreNewt::Contact::m_parent
protected

Definition at line 204 of file OgreNewt_ContactJoint.h.


The documentation for this class was generated from the following files: