Isis 3 Programmer Reference
|
Bullet World manager maintains a proper state for target bodies. More...
#include <BulletWorldManager.h>
Public Member Functions | |
BulletWorldManager () | |
Default empty constructor. More... | |
BulletWorldManager (const QString &name) | |
Construct a world manager with a given name. More... | |
virtual | ~BulletWorldManager () |
Destroys the BulletWorldManager. More... | |
QString | name () const |
Name of the world. More... | |
int | size () const |
Number of collision objects in the world. More... | |
BulletTargetShape * | getTarget (const int &index=0) const |
Return a collision object by index into the world. More... | |
BulletTargetShape * | getTarget (const QString &name) const |
Look for a specific collision object by name. More... | |
void | addTarget (BulletTargetShape *target) |
Add a Bullet shape to the collision world. More... | |
bool | raycast (const btVector3 &observer, const btVector3 &lookdir, btCollisionWorld::RayResultCallback &hits) const |
Perform ray casting from a position and a look direction. More... | |
const btCollisionWorld & | getWorld () const |
Get the Collision World where the targets exist. More... | |
Private Member Functions | |
void | initWorld () |
Initialize the collision world for object ray tracing. More... | |
Private Attributes | |
QString | m_name |
QScopedPointer< btDefaultCollisionConfiguration > | m_collision |
! The name of the Bullet world. More... | |
QScopedPointer< btCollisionDispatcher > | m_dispatcher |
! The collision configuration for the world. More... | |
QScopedPointer< btBroadphaseInterface > | m_broadphase |
! The dispatcher for the world. More... | |
QScopedPointer< btCollisionWorld > | m_world |
! The interface for overlaps in the world's aabb acceleration tree. More... | |
QMutex | m_mutex |
! The Bullet collision world that contains the representation of the body. More... | |
Bullet World manager maintains a proper state for target bodies.
This class maintains the physics world created in Bullet-verse. This world is target-centric in that the center of the world is the center of the target (body-fixed) coordinate system. This could be changed to represent some other system (e.g., J2000), However this design allows one to operate on a per target basis.
This class uses only the collision body world of Bullet, which is static and will not be subject to simulation operations.
This design also allows for a whole target body DEM to be loaded or a large body broken up into smaller parts of the whole if needed.
Definition at line 57 of file BulletWorldManager.h.
Isis::BulletWorldManager::BulletWorldManager | ( | ) |
Default empty constructor.
Definition at line 45 of file BulletWorldManager.cpp.
Isis::BulletWorldManager::BulletWorldManager | ( | const QString & | name | ) |
Construct a world manager with a given name.
name | The name of the world. |
Definition at line 56 of file BulletWorldManager.cpp.
|
virtual |
Destroys the BulletWorldManager.
Definition at line 65 of file BulletWorldManager.cpp.
void Isis::BulletWorldManager::addTarget | ( | BulletTargetShape * | target | ) |
Add a Bullet shape to the collision world.
target | The target shape to add to the world. |
Definition at line 130 of file BulletWorldManager.cpp.
References Isis::BulletTargetShape::body().
BulletTargetShape * Isis::BulletWorldManager::getTarget | ( | const int & | index = 0 | ) | const |
Return a collision object by index into the world.
index | Index from 0 to size()-1 of the object that exist in the world |
Definition at line 95 of file BulletWorldManager.cpp.
BulletTargetShape * Isis::BulletWorldManager::getTarget | ( | const QString & | name | ) | const |
Look for a specific collision object by name.
name | Name of collision object to search for |
Definition at line 109 of file BulletWorldManager.cpp.
References Isis::BulletTargetShape::name().
const btCollisionWorld & Isis::BulletWorldManager::getWorld | ( | ) | const |
Get the Collision World where the targets exist.
Definition at line 168 of file BulletWorldManager.cpp.
|
private |
Initialize the collision world for object ray tracing.
Definition at line 178 of file BulletWorldManager.cpp.
QString Isis::BulletWorldManager::name | ( | ) | const |
Name of the world.
Definition at line 73 of file BulletWorldManager.cpp.
bool Isis::BulletWorldManager::raycast | ( | const btVector3 & | rayStart, |
const btVector3 & | rayEnd, | ||
btCollisionWorld::RayResultCallback & | results | ||
) | const |
Perform ray casting from a position and a look direction.
rayStart | The origin of the ray | |
rayEnd | The end point of the ray | |
[in,out] | results | Ray intersection callback. holds the output results of the ray cast. The type of callback determines what happens when an intersection is found during ray casting. |
Definition at line 156 of file BulletWorldManager.cpp.
int Isis::BulletWorldManager::size | ( | ) | const |
Number of collision objects in the world.
Definition at line 83 of file BulletWorldManager.cpp.
|
private |
! The dispatcher for the world.
Definition at line 86 of file BulletWorldManager.h.
|
private |
! The name of the Bullet world.
Definition at line 81 of file BulletWorldManager.h.
|
private |
! The collision configuration for the world.
Definition at line 84 of file BulletWorldManager.h.
|
mutableprivate |
! The Bullet collision world that contains the representation of the body.
Mutex for thread safety
Definition at line 93 of file BulletWorldManager.h.
|
private |
! The interface for overlaps in the world's aabb acceleration tree.
Definition at line 89 of file BulletWorldManager.h.