#include <vpWorld.h>
Public Member Functions | |
| void | AddBody (vpBody *) |
| void | AddWorld (vpWorld *) |
| void | SetGlobalFrame (const SE3 &) |
| const SE3 & | GetGlobalFrame (void) const |
| void | Initialize (void) |
| virtual void | StepAhead (void) |
| void | SetTimeStep (scalar) |
| scalar | GetTimeStep (void) const |
| void | SetIntegrator (VP::INTEGRATOR_TYPE type) |
| scalar | GetBoundingSphere (Vec3 ¢er) const |
| void | SetGravity (const Vec3 &) |
| const Vec3 & | GetGravity (void) const |
| void | EnableCollision (bool=true) |
| void | IgnoreCollision (vpBody *B0, vpBody *B1) |
| scalar | GetSimulationTime (void) const |
| scalar | GetKineticEnergy (void) const |
| scalar | GetPotentialEnergy (void) const |
| scalar | GetTotalEnergy (void) const |
| int | GetNumBody (void) const |
| int | GetNumGeometry (void) const |
| const vpBody * | GetBody (int) const |
| const vpBody * | GetBodyByName (const string &name) const |
| void | BackupState (void) |
| void | RollbackState (void) |
| void | UpdateFrame (void) |
| int | GetNumMaterial (void) const |
| const vpMaterial * | GetMaterial (int) const |
| const vpMaterial * | GetMaterialByName (const string &name) const |
| int | GetNumJoint (void) const |
| const vpJoint * | GetJoint (int) const |
| const vpJoint * | GetJointByName (const string &name) const |
| void | Clear (void) |
Friends | |
| ostream & | operator<< (ostream &, const vpWorld &) |
| istream & | operator>> (istream &, vpWorld &) |
| void vpWorld::AddBody | ( | vpBody * | ) |
add a body to the world
| void vpWorld::AddWorld | ( | vpWorld * | ) |
add a world
World's parameters such as a time step and the gravity will not be updated with newly added world'parameters. Only the body and joints will be added.
| VP_INLINE void vpWorld::SetGlobalFrame | ( | const SE3 & | T | ) |
set a global frame
All the coordinate frame is represented by this global frame. Should be followed by vpWorld::Initialize.
| VP_INLINE const SE3 & vpWorld::GetGlobalFrame | ( | void | ) | const |
set a global frame
| void vpWorld::Initialize | ( | void | ) |
initialize the world. Before simulation, the world should be initialized.
| virtual void vpWorld::StepAhead | ( | void | ) | [virtual] |
| VP_INLINE void vpWorld::SetTimeStep | ( | scalar | t | ) |
set simulation time step used in integrating dynamics equations. Default time step is 0.001. For stable simulation, smaller time step is preferred. However how small the time step can depend on your model.
| VP_INLINE scalar vpWorld::GetTimeStep | ( | void | ) | const |
get a current time step.
| void vpWorld::SetIntegrator | ( | VP::INTEGRATOR_TYPE | type | ) |
| scalar vpWorld::GetBoundingSphere | ( | Vec3 & | center | ) | const |
get a bounding sphere including whole world.
| VP_INLINE void vpWorld::SetGravity | ( | const Vec3 & | g | ) |
set a gravity. Default is zero gravity.
| VP_INLINE const Vec3 & vpWorld::GetGravity | ( | void | ) | const |
get a gravity.
| VP_INLINE void vpWorld::EnableCollision | ( | bool | flag = true |
) |
enable or disable collision between bodies.
declare that collision of B0 and B1 will be ignored.
| VP_INLINE scalar vpWorld::GetSimulationTime | ( | void | ) | const |
get a simulation time.
| scalar vpWorld::GetKineticEnergy | ( | void | ) | const |
get a kinetic energy.
| scalar vpWorld::GetPotentialEnergy | ( | void | ) | const |
get a potential energy.
| VP_INLINE scalar vpWorld::GetTotalEnergy | ( | void | ) | const |
get a total energy(= kinetic energy + potential energy).
| VP_INLINE int vpWorld::GetNumBody | ( | void | ) | const |
get a number of bodies in the world.
| int vpWorld::GetNumGeometry | ( | void | ) | const |
get a number of geometries in the world.
| VP_INLINE const vpBody * vpWorld::GetBody | ( | int | idx | ) | const |
| const vpBody* vpWorld::GetBodyByName | ( | const string & | name | ) | const |
get a pointer to the body with the name
| void vpWorld::BackupState | ( | void | ) |
keep current states which are transformation matrices, velocities, joint angles, joint velocities.
| void vpWorld::RollbackState | ( | void | ) |
restore states to the values kept by BackupState()
| void vpWorld::UpdateFrame | ( | void | ) |
update transformation matrices from joint angles.
It is useful when you change joint angles and want to compute corresponding transformation matrices of articulated bodies. Basically, VP does not compute transformation matrices of bodies even if you change the joint angles. The transformation matrices or relevant values will be updated after the simulation which is typically done by calling vpWorld::StepAhead().
| VP_INLINE int vpWorld::GetNumMaterial | ( | void | ) | const |
get a number of materials defined in the world
| VP_INLINE const vpMaterial * vpWorld::GetMaterial | ( | int | idx | ) | const |
get a pointer to the ith material
| const vpMaterial* vpWorld::GetMaterialByName | ( | const string & | name | ) | const |
get a pointer to the material with the name
| VP_INLINE int vpWorld::GetNumJoint | ( | void | ) | const |
get a number of joints in the world
| VP_INLINE const vpJoint * vpWorld::GetJoint | ( | int | idx | ) | const |
get a pointer to the ith joint
| const vpJoint* vpWorld::GetJointByName | ( | const string & | name | ) | const |
get a pointer to the joint with the name
| void vpWorld::Clear | ( | void | ) |
clear all the instances managed by the world
| ostream& operator<< | ( | ostream & | , | |
| const vpWorld & | ||||
| ) | [friend] |
print out current configuration of the wolrd in XML format.
| istream& operator>> | ( | istream & | , | |
| vpWorld & | ||||
| ) | [friend] |
read the configuration generated from output stream
1.5.5