Isis Developer Reference
BulletWorldManager.h
Go to the documentation of this file.
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.
Definition BulletTargetShape.h:33
Bullet World manager maintains a proper state for target bodies.
Definition BulletWorldManager.h:41
bool raycast(const btVector3 &observer, const btVector3 &lookdir, btCollisionWorld::RayResultCallback &hits) const
Perform ray casting from a position and a look direction.
Definition BulletWorldManager.cpp:139
void addTarget(BulletTargetShape *target)
Add a Bullet shape to the collision world.
Definition BulletWorldManager.cpp:113
virtual ~BulletWorldManager()
Destroys the BulletWorldManager.
Definition BulletWorldManager.cpp:48
QString name() const
Name of the world.
Definition BulletWorldManager.cpp:56
BulletTargetShape * getTarget(const int &index=0) const
Return a collision object by index into the world.
Definition BulletWorldManager.cpp:78
const btCollisionWorld & getWorld() const
Get the Collision World where the targets exist.
Definition BulletWorldManager.cpp:151
BulletWorldManager()
Default empty constructor.
Definition BulletWorldManager.cpp:28
int size() const
Number of collision objects in the world.
Definition BulletWorldManager.cpp:66
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16