8#include "BulletWorldManager.h"
15#include <QMutexLocker>
18#include "IException.h"
29 m_name =
"Body-Fixed-Coordinate-System";
67 return (
m_world->getCollisionObjectArray().size() );
79 btAssert( index <
size() );
80 btAssert( index >= 0 );
94 QString v_name =
name.toLower();
95 const btCollisionObjectArray &btobjects =
m_world->getCollisionObjectArray();
96 for (
int i = 0 ; i < btobjects.size() ; i++ ) {
98 if ( target->
name().toLower() == v_name ) {
140 btCollisionWorld::RayResultCallback &results )
const {
141 m_world->rayTest(rayStart, rayEnd, results);
142 return ( results.hasHit() );
162 m_collision.reset(
new btDefaultCollisionConfiguration() );
Bullet Target Shape for planetary bodies.
btCollisionObject * body() const
Return a pointer to the Bullet target object/shape.
QString name() const
Return name of the target shape.
bool raycast(const btVector3 &observer, const btVector3 &lookdir, btCollisionWorld::RayResultCallback &hits) const
Perform ray casting from a position and a look direction.
QScopedPointer< btCollisionWorld > m_world
! The interface for overlaps in the world's aabb acceleration tree.
void addTarget(BulletTargetShape *target)
Add a Bullet shape to the collision world.
virtual ~BulletWorldManager()
Destroys the BulletWorldManager.
void initWorld()
Initialize the collision world for object ray tracing.
QScopedPointer< btCollisionDispatcher > m_dispatcher
! The collision configuration for the world.
QString name() const
Name of the world.
QScopedPointer< btDefaultCollisionConfiguration > m_collision
! The name of the Bullet world.
BulletTargetShape * getTarget(const int &index=0) const
Return a collision object by index into the world.
const btCollisionWorld & getWorld() const
Get the Collision World where the targets exist.
QScopedPointer< btBroadphaseInterface > m_broadphase
! The dispatcher for the world.
BulletWorldManager()
Default empty constructor.
int size() const
Number of collision objects in the world.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.