17 #include <unordered_set> 19 #include "core/vector.hpp" 20 #include "core/matrix.hpp" 193 const std::unordered_set<Entity*> &
children()
const;
230 const T*
self =
dynamic_cast<const T*
>(
this);
232 list.push_back(
self);
233 for(
Entity *c : _children)
234 c->queryAll<T>(list);
240 std::unordered_set<Entity*> _children;
242 void updateGlobalMatrix()
const;
Basic space entity.
Definition: entity.hpp:50
virtual ~Entity()=0
Destructor.
Definition: entity.cpp:27
void setScene(Scene *)
Set the scene of the entity.
Definition: entity.cpp:124
void setPosition(const vector &pos)
Set the entity position.
Definition: entity.cpp:91
const vector & position() const
Entity location.
Definition: entity.cpp:83
const matrix & globalMatrix() const
The global matrix of the entity.
Definition: entity.cpp:69
void setRotation(const vector &rot)
Set the entity rotation.
Definition: entity.cpp:96
Complete scene.
Definition: scene.hpp:42
void removeChild(Entity *)
Remove a child.
Definition: entity.cpp:146
const matrix & invertedGlobalMatrix() const
The invert of the global matrix of the entity.
Definition: entity.cpp:74
void soil()
Make an entity dirty.
Definition: entity.cpp:58
3D vector
Definition: vector.hpp:28
const std::unordered_set< Entity * > & children() const
Entity children.
Definition: entity.cpp:138
vector globalPosition() const
Global position of the entity.
Definition: entity.cpp:79
const vector & rotation() const
Entity rotation.
Definition: entity.cpp:87
4x4 matrix
Definition: matrix.hpp:33
virtual void update()
Update the global matrix of the entity and its children.
Definition: entity.cpp:34
void setParent(Entity *)
Set the parent entity.
Definition: entity.cpp:105
Entity(Entity *parent=0)
Default entity constructor.
Definition: entity.cpp:6
void queryAll(std::list< const T *> &list) const
Get the list of a specific type of entity.
Definition: entity.hpp:229
bool isDirty() const
Definition: entity.cpp:65
void addChild(Entity *)
Add a child.
Definition: entity.cpp:142
Entity * parent() const
The parent entity.
Definition: entity.cpp:101
Scene * scene() const
The scene of the entity.
Definition: entity.cpp:120