SPIN Framework
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

spin::CollisionShape Class Reference

Provides an interface to bullet physics modelling. More...

#include <CollisionShape.h>

Inheritance diagram for spin::CollisionShape:
spin::ShapeNode spin::GroupNode spin::ReferencedNode

List of all members.

Public Member Functions

 CollisionShape (SceneManager *sceneManager, const char *initID)
virtual void callbackUpdate (osg::NodeVisitor *nv)
virtual void debug ()
void setMass (float mass)
float getMass () const
void setDynamic (int isDynamic)
int getDynamic () const
bool checkCollisions (btTransform tranform)
virtual void setTranslation (float x, float y, float z)
virtual void setOrientationQuat (float x, float y, float z, float w)
virtual void setOrientation (float pitch, float roll, float yaw)
virtual void setScale (float x, float y, float z)
virtual void setManipulatorMatrix (float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33)
virtual std::vector< lo_message > getState () const

Public Attributes

osg::Vec3 collisionOffset_

Protected Member Functions

virtual void drawShape ()

Protected Attributes

btRigidBody * body_
btCollisionShape * collisionObj_
btTransform currentTransform_

Detailed Description

Provides an interface to bullet physics modelling.


Member Function Documentation

void spin::CollisionShape::callbackUpdate ( osg::NodeVisitor *  nv) [virtual]

For nodes that require regular programmatic control, there is a callback that is evaluated with every refresh. This function can thus be used for animations, or any other periodic updates.

Note that changes to the scene graph structure (eg, moving/deleting nodes should NOT be done within this callback because traversals stacks will become corrupted. The technique is rather to enable a flag and then do the actual change in the SceneManager::updateGraph() method.

Reimplemented from spin::GroupNode.

void spin::CollisionShape::debug ( ) [virtual]

Print debug information about the node to standard out (when running in console mode). It may be possible to redirect this to a text box for GUI logs.

Reimplemented from spin::GroupNode.

std::vector< lo_message > spin::CollisionShape::getState ( ) const [virtual]

For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node

Reimplemented from spin::ShapeNode.

void spin::CollisionShape::setDynamic ( int  isDynamic)

Enable external dynamic forces (eg, gravity). Note: object must have non-zero mass for this to work.

void spin::CollisionShape::setMass ( float  mass)

Set the mass of the object. A value of 0 makes the object static (unmovable) by the dynamics engine. Only direct transformation through GroupNode functions will have any effect.

void spin::CollisionShape::setOrientation ( float  pitch,
float  roll,
float  yaw 
) [virtual]

The local orientation offset for this node with respect to it's parent

Reimplemented from spin::GroupNode.

void spin::CollisionShape::setOrientationQuat ( float  x,
float  y,
float  z,
float  w 
) [virtual]

Set the orientation offset as a quaternion

Reimplemented from spin::GroupNode.

void spin::CollisionShape::setScale ( float  x,
float  y,
float  z 
) [virtual]

A grouped scale operation

Reimplemented from spin::GroupNode.

void spin::CollisionShape::setTranslation ( float  x,
float  y,
float  z 
) [virtual]

The local translation offset for this node with respect to it's parent

Reimplemented from spin::GroupNode.


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