Isis 3 Programmer Reference
BulletWorldManager.h
1#ifndef BulletWorldManager_h
2#define BulletWorldManager_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <QCache>
11#include <QMutex>
12#include <QScopedPointer>
13#include <QString>
14#include <QtGlobal>
15
16#include "IsisBullet.h"
17#include "BulletTargetShape.h"\
18
19namespace Isis {
20
42 public:
44 BulletWorldManager(const QString &name);
45 virtual ~BulletWorldManager();
46
47 QString name() const;
48 int size() const;
49
50 BulletTargetShape *getTarget(const int &index = 0) const;
51 BulletTargetShape *getTarget(const QString &name) const;
52 void addTarget(BulletTargetShape *target);
53
54 bool raycast( const btVector3 &observer, const btVector3 &lookdir,
55 btCollisionWorld::RayResultCallback &hits ) const;
56
57 const btCollisionWorld &getWorld() const;
58
59
60 private:
61 Q_DISABLE_COPY(BulletWorldManager)
62
63 QString m_name;
65 QScopedPointer<btDefaultCollisionConfiguration> m_collision;
68 QScopedPointer<btCollisionDispatcher> m_dispatcher;
70 QScopedPointer<btBroadphaseInterface> m_broadphase;
73 QScopedPointer<btCollisionWorld> m_world;
77 mutable QMutex m_mutex;
78
79 void initWorld();
80
81 };
82
83} // namespace Isis
84
85#endif
86
Bullet Target Shape for planetary bodies.
Bullet World manager maintains a proper state for target bodies.
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.
QMutex m_mutex
! The Bullet collision world that contains the representation of the body.
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.
Definition Apollo.h:16