Main unit of gameplay which contains and updated components.
More...
#include <GameObject.hpp>
|
std::weak_ptr< GameObject > | GetThisPtr () |
|
virtual void | Input () |
| Refreshes input for all components and children each frame.
|
|
virtual void | Update (float dt) |
| Runs Update on all components and children.
|
|
virtual void | Render () |
| Renders all components and children.
|
|
template<typename T > |
void | AddComponent (std::shared_ptr< T > component) |
| Adds a component of the specified type.
|
|
template<typename T > |
std::shared_ptr< T > | GetComponent () |
| Retrieves an existing component of the specified type, or nullptr if there is none.
|
|
void | AddChild (std::shared_ptr< GameObject > child) |
| Adds a child GameObject to this GameObject.
|
|
std::shared_ptr< GameObject > | GetChildAtIndex (size_t idx) |
|
void | SetRenderable (bool renderable) |
|
bool | IsRenderable () const |
| Queries if this GameObject can be rendered.
|
|
bool | Intersects (std::shared_ptr< GameObject > e) |
|
|
std::map< ComponentType, std::shared_ptr< Component > > | mComponents |
|
bool | mRenderable {true} |
|
std::vector< std::shared_ptr< GameObject > > | mChildren |
|
Main unit of gameplay which contains and updated components.
◆ GetChildAtIndex()
std::shared_ptr< GameObject > GameObject::GetChildAtIndex |
( |
size_t | idx | ) |
|
◆ Intersects()
bool GameObject::Intersects |
( |
std::shared_ptr< GameObject > | e | ) |
|
Determines the intersection between this GameObject and another
- Parameters
-
◆ SetRenderable()
void GameObject::SetRenderable |
( |
bool | renderable | ) |
|
Changes whether or not this GameObject is being rendered
- Parameters
-
renderable | The value to set |
The documentation for this struct was generated from the following files: