3 #include "util/shared_ptr.h" 4 #include "util/weak_ptr.h" 5 #include "util/vector.h" 6 #include "util/queue.h" 7 #include "util/string.h" 8 #include "renderer/mesh.h" 9 #include "renderer/buffers/upload_buffer.h" 10 #include <DirectXMath.h> DirectX::XMFLOAT3 position_
The local position of this Entity.
Definition: entity.h:153
The Blowbox equivalent of a game object.
Definition: entity.h:26
void Shutdown()
Shuts down the Entity.
Definition: entity.cc:124
void SetLocalRotation(const DirectX::XMFLOAT3 &rotation)
Sets the local rotation of this Entity.
Definition: entity.cc:48
SharedPtr< Mesh > GetMesh() const
Definition: entity.cc:86
bool GetInScene() const
Returns whether the Entity is present in the SceneManager.
Definition: entity.cc:173
eastl::vector< T > Vector
Typedef for wrapping the EASTL vector.
Definition: vector.h:14
void SetMesh(SharedPtr< Mesh > mesh)
Sets the Mesh of this Entity.
Definition: entity.cc:62
void SetInScene(bool in_scene)
Sets whether the Entity is present in the SceneManager.
Definition: entity.cc:162
Manages the entire scene.
Definition: scene_manager.h:19
SharedPtr< Mesh > mesh_
The Mesh object that is attached to this Entity.
Definition: entity.h:161
const DirectX::XMFLOAT3 & GetLocalPosition() const
Definition: entity.cc:68
void UpdateWorldTransform()
Updates the world transform based on current position, rotation and scaling.
Definition: entity.cc:185
Factory for creating Entity instances and managing Entity children.
Definition: entity_factory.h:16
Entity(const String &name)
Constructs an Entity.
Definition: entity.cc:10
UploadBuffer constant_buffer_
This Entity's constant buffer.
Definition: entity.h:162
const DirectX::XMFLOAT3 & GetLocalRotation() const
Definition: entity.cc:74
void SetLocalScaling(const DirectX::XMFLOAT3 &scaling)
Sets the local scaling of this Entity.
Definition: entity.cc:55
const DirectX::XMMATRIX & GetWorldTransform()
Returns the world transform of this Entity.
Definition: entity.cc:92
eastl::weak_ptr< T > WeakPtr
Typedef for wrapping the EASTL weak_ptr.
Definition: weak_ptr.h:14
const Vector< SharedPtr< Entity > > & GetChildren() const
Definition: entity.cc:103
DirectX::XMFLOAT3 scaling_
The local scaling of this Entity.
Definition: entity.h:155
void Init()
Initialises the Entity.
Definition: entity.cc:109
bool IsTransformDirty()
Returns whether the transform is dirty.
Definition: entity.cc:179
DirectX::XMMATRIX world_transform_
The world transform of this Entity.
Definition: entity.h:156
const String & GetName() const
Returns the name of this Entity.
Definition: entity.cc:35
eastl::string String
Typedef for wrapping the EASTL string.
Definition: string.h:13
void SetName(const String &name)
Sets the name of this Entity.
Definition: entity.cc:29
const DirectX::XMFLOAT3 & GetLocalScaling() const
Definition: entity.cc:80
void Update()
Updates the Entity.
Definition: entity.cc:115
The main Blowbox namespace.
Definition: image.cc:8
bool transform_dirty_
Whether the current world_transform_ is dirty (i.e. position/rotation/scaling changed).
Definition: entity.h:157
bool RemoveChild(SharedPtr< Entity > entity)
Removes a child Entity from this Entity.
Definition: entity.cc:147
bool in_scene_
Flag that determines whether this Entity exists in the SceneManager.
Definition: entity.h:159
String name_
The name of this Entity.
Definition: entity.h:148
DirectX::XMFLOAT3 rotation_
The local rotation of this Entity.
Definition: entity.h:154
bool AddChild(SharedPtr< Entity > entity)
Adds a child Entity to this Entity.
Definition: entity.cc:130
Wraps upload buffer types, which allow you to upload data to the GPU.
Definition: upload_buffer.h:19
eastl::shared_ptr< T > SharedPtr
Typedef for wrapping the EASTL shared_ptr.
Definition: shared_ptr.h:14
Vector< SharedPtr< Entity > > children_
All the children of this Entity.
Definition: entity.h:150
void SetLocalPosition(const DirectX::XMFLOAT3 &position)
Sets the local position of this Entity.
Definition: entity.cc:41
~Entity()
Destructs the Entity.
Definition: entity.cc:23
UploadBuffer & GetConstantBuffer()
Definition: entity.h:99
WeakPtr< Entity > parent_
The parent of this Entity.
Definition: entity.h:149