Isis 3 Programmer Reference
Isis::BulletWorldManager Class Reference

Bullet World manager maintains a proper state for target bodies. More...

#include <BulletWorldManager.h>

Collaboration diagram for Isis::BulletWorldManager:
Collaboration graph

Public Member Functions

 BulletWorldManager ()
 Default empty constructor.
 
 BulletWorldManager (const QString &name)
 Construct a world manager with a given name.
 
virtual ~BulletWorldManager ()
 Destroys the BulletWorldManager.
 
QString name () const
 Name of the world.
 
int size () const
 Number of collision objects in the world.
 
BulletTargetShapegetTarget (const int &index=0) const
 Return a collision object by index into the world.
 
BulletTargetShapegetTarget (const QString &name) const
 Look for a specific collision object by name.
 
void addTarget (BulletTargetShape *target)
 Add a Bullet shape to the collision world.
 
bool raycast (const btVector3 &observer, const btVector3 &lookdir, btCollisionWorld::RayResultCallback &hits) const
 Perform ray casting from a position and a look direction.
 
const btCollisionWorld & getWorld () const
 Get the Collision World where the targets exist.
 

Private Member Functions

void initWorld ()
 Initialize the collision world for object ray tracing.
 

Private Attributes

QString m_name
 
QScopedPointer< btDefaultCollisionConfiguration > m_collision
 ! The name of the Bullet world.
 
QScopedPointer< btCollisionDispatcher > m_dispatcher
 ! The collision configuration for the world.
 
QScopedPointer< btBroadphaseInterface > m_broadphase
 ! The dispatcher for the world.
 
QScopedPointer< btCollisionWorld > m_world
 ! The interface for overlaps in the world's aabb acceleration tree.
 
QMutex m_mutex
 ! The Bullet collision world that contains the representation of the body.
 

Detailed Description

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.

Author
2017-03-17 Kris Becker
History
2017-03-17 Kris Becker Original Version

Definition at line 41 of file BulletWorldManager.h.

Constructor & Destructor Documentation

◆ BulletWorldManager() [1/2]

Isis::BulletWorldManager::BulletWorldManager ( )

Default empty constructor.

Definition at line 28 of file BulletWorldManager.cpp.

References initWorld().

◆ BulletWorldManager() [2/2]

Isis::BulletWorldManager::BulletWorldManager ( const QString & name)

Construct a world manager with a given name.

Parameters
nameThe name of the world.

Definition at line 39 of file BulletWorldManager.cpp.

References initWorld(), and name().

◆ ~BulletWorldManager()

Isis::BulletWorldManager::~BulletWorldManager ( )
virtual

Destroys the BulletWorldManager.

Definition at line 48 of file BulletWorldManager.cpp.

Member Function Documentation

◆ addTarget()

void Isis::BulletWorldManager::addTarget ( BulletTargetShape * target)

Add a Bullet shape to the collision world.

Parameters
targetThe target shape to add to the world.

Definition at line 113 of file BulletWorldManager.cpp.

References Isis::BulletTargetShape::body(), and m_world.

◆ getTarget() [1/2]

BulletTargetShape * Isis::BulletWorldManager::getTarget ( const int & index = 0) const

Return a collision object by index into the world.

Parameters
indexIndex from 0 to size()-1 of the object that exist in the world
Returns
BulletTargetShape* Pointer to shape if found.

Definition at line 78 of file BulletWorldManager.cpp.

References m_world, and size().

◆ getTarget() [2/2]

BulletTargetShape * Isis::BulletWorldManager::getTarget ( const QString & name) const

Look for a specific collision object by name.

Parameters
nameName of collision object to search for
Returns
BulletTargetShape* Pointer to shape if found. Otherwise null.

Definition at line 92 of file BulletWorldManager.cpp.

References m_world, Isis::BulletTargetShape::name(), and name().

◆ getWorld()

const btCollisionWorld & Isis::BulletWorldManager::getWorld ( ) const

Get the Collision World where the targets exist.

Returns
btCollisionWorld The Bullet collision world used for ray casting.

Definition at line 151 of file BulletWorldManager.cpp.

References m_world.

◆ initWorld()

void Isis::BulletWorldManager::initWorld ( )
private

Initialize the collision world for object ray tracing.

Author
2017-03-17 Kris Becker

Definition at line 161 of file BulletWorldManager.cpp.

References m_broadphase, m_collision, m_dispatcher, and m_world.

Referenced by BulletWorldManager(), and BulletWorldManager().

◆ name()

QString Isis::BulletWorldManager::name ( ) const

Name of the world.

Returns
QString The name of the Bullet collision world.

Definition at line 56 of file BulletWorldManager.cpp.

Referenced by BulletWorldManager(), and getTarget().

◆ raycast()

bool Isis::BulletWorldManager::raycast ( const btVector3 & rayStart,
const btVector3 & rayEnd,
btCollisionWorld::RayResultCallback & results ) const

Perform ray casting from a position and a look direction.

Author
2017-03-17 Kris Becker
Parameters
rayStartThe origin of the ray
rayEndThe end point of the ray
[in,out]resultsRay 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.
Returns
bool Returns true if any intersections are detected
See also
btCollisionWorld::rayTest

Definition at line 139 of file BulletWorldManager.cpp.

References m_world.

◆ size()

int Isis::BulletWorldManager::size ( ) const

Number of collision objects in the world.

Returns
int The number of collision objects in the world.

Definition at line 66 of file BulletWorldManager.cpp.

References m_world.

Referenced by getTarget().

Member Data Documentation

◆ m_broadphase

QScopedPointer<btBroadphaseInterface> Isis::BulletWorldManager::m_broadphase
private

! The dispatcher for the world.

Definition at line 70 of file BulletWorldManager.h.

Referenced by initWorld().

◆ m_collision

QScopedPointer<btDefaultCollisionConfiguration> Isis::BulletWorldManager::m_collision
private

! The name of the Bullet world.

Definition at line 65 of file BulletWorldManager.h.

Referenced by initWorld().

◆ m_dispatcher

QScopedPointer<btCollisionDispatcher> Isis::BulletWorldManager::m_dispatcher
private

! The collision configuration for the world.

Definition at line 68 of file BulletWorldManager.h.

Referenced by initWorld().

◆ m_mutex

QMutex Isis::BulletWorldManager::m_mutex
mutableprivate

! The Bullet collision world that contains the representation of the body.

Mutex for thread safety

Definition at line 77 of file BulletWorldManager.h.

◆ m_name

QString Isis::BulletWorldManager::m_name
private

Definition at line 63 of file BulletWorldManager.h.

◆ m_world

QScopedPointer<btCollisionWorld> Isis::BulletWorldManager::m_world
private

! The interface for overlaps in the world's aabb acceleration tree.

Definition at line 73 of file BulletWorldManager.h.

Referenced by addTarget(), getTarget(), getTarget(), getWorld(), initWorld(), raycast(), and size().


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