Tinman  1.0
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Physics Class Reference

#include <physics.h>

Public Types

typedef std::pair< const btCollisionObject *, const btCollisionObject * > CollisionPair
 
typedef std::map< CollisionPair, std::function< void()> > Triggers
 
typedef std::shared_ptr< Physicsshared
 

Public Member Functions

 Physics ()
 
virtual ~Physics ()
 
btRigidBody * create_rigid_body (const btTransform &world_transform, Ogre::SceneNode *node, btCollisionShape *shape, btScalar mass)
 
void add_rigid_body (btRigidBody *body_)
 
btRigidBody * create_rigid_body (const btTransform &world_transform, btCollisionShape *shape, btScalar mass)
 
void remove_rigid_body (btRigidBody *body)
 
btCollisionShape * create_shape (btVector3 halfExtent)
 
btCollisionShape * create_shape (float radius)
 
btCollisionShape * create_shape (MeshStrider *strider)
 
btCollisionShape * create_shape (btVector3 coordinates, btScalar distance_to_origin)
 
btCompoundShape * create_compound_shape (btVector3 origin, btCollisionShape *child)
 
void step_simulation (float deltaT, int maxSubSteps)
 
void load_mesh (std::string file)
 
void check_collision ()
 
void clear_triggers ()
 
void add_collision_hooks (CollisionPair key, std::function< void()> callback)
 
void set_position (btRigidBody *body, btVector3 new_position)
 
void set_transform (btRigidBody *body, btTransform transform)
 
btCollisionWorld::ClosestRayResultCallback raytest (btVector3 position, btVector3 next_destination)
 
void print_vector (std::string message, btVector3 vector3)
 
btVector3 rotate_vector (btVector3 vector, btVector3 axis, btScalar angle)
 
btScalar get_angle (btVector3 origin, btVector3 destiny)
 

Public Attributes

btDiscreteDynamicsWorld * dynamics_world_
 
const btScalar PI = 3.14159265359
 

Private Attributes

const btVector3 gravity_ = btVector3(0, -40, 0)
 
btBroadphaseInterface * broadphase_
 
btSequentialImpulseConstraintSolver * solver_
 
btDefaultCollisionConfiguration * collision_configuration_
 
btCollisionDispatcher * dispatcher_
 
Triggers triggers_
 

Member Typedef Documentation

typedef std::pair<const btCollisionObject*, const btCollisionObject*> Physics::CollisionPair
typedef std::shared_ptr<Physics> Physics::shared
typedef std::map<CollisionPair, std::function<void()> > Physics::Triggers

Constructor & Destructor Documentation

Physics::Physics ( )
Physics::~Physics ( )
virtual

Member Function Documentation

void Physics::add_collision_hooks ( Physics::CollisionPair  collision_pair,
std::function< void()>  callback 
)
void Physics::add_rigid_body ( btRigidBody *  body_)
void Physics::check_collision ( )
void Physics::clear_triggers ( )
btCompoundShape * Physics::create_compound_shape ( btVector3  origin,
btCollisionShape *  child 
)
btRigidBody * Physics::create_rigid_body ( const btTransform &  world_transform,
Ogre::SceneNode *  node,
btCollisionShape *  shape,
btScalar  mass 
)
btRigidBody * Physics::create_rigid_body ( const btTransform &  world_transform,
btCollisionShape *  shape,
btScalar  mass 
)
btCollisionShape * Physics::create_shape ( btVector3  halfExtent)
btCollisionShape * Physics::create_shape ( float  radius)
btCollisionShape * Physics::create_shape ( MeshStrider strider)
btCollisionShape * Physics::create_shape ( btVector3  coordinates,
btScalar  distance_to_origin 
)
btScalar Physics::get_angle ( btVector3  origin,
btVector3  destiny 
)
void Physics::load_mesh ( std::string  file)
void Physics::print_vector ( std::string  message,
btVector3  vector3 
)
btCollisionWorld::ClosestRayResultCallback Physics::raytest ( btVector3  position,
btVector3  next_destination 
)
void Physics::remove_rigid_body ( btRigidBody *  body)
btVector3 Physics::rotate_vector ( btVector3  vector,
btVector3  axis,
btScalar  angle 
)
void Physics::set_position ( btRigidBody *  body,
btVector3  new_position 
)
void Physics::set_transform ( btRigidBody *  body,
btTransform  transform 
)
void Physics::step_simulation ( float  deltaT,
int  maxSubSteps 
)

Member Data Documentation

btBroadphaseInterface* Physics::broadphase_
private
btDefaultCollisionConfiguration* Physics::collision_configuration_
private
btCollisionDispatcher* Physics::dispatcher_
private
btDiscreteDynamicsWorld* Physics::dynamics_world_
const btVector3 Physics::gravity_ = btVector3(0, -40, 0)
private
const btScalar Physics::PI = 3.14159265359
btSequentialImpulseConstraintSolver* Physics::solver_
private
Triggers Physics::triggers_
private

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