#include <tb_component.hpp>
Public Member Functions | |
| virtual void | OnAwake (void) |
| virtual void | OnDestroy (void) |
| virtual void | OnActivate (void) |
| virtual void | OnDeactivate (void) |
| virtual void | OnSimulate (void) |
| virtual void | OnUpdate (const float) |
| virtual void | OnRender (void) const |
| virtual void | OnTriggerEnter (const Node &) |
| virtual void | OnTriggerStay (const Node &) |
| virtual void | OnTriggerLeave (const Node &) |
| const Node & | GetNode (void) const |
| bool | IsValid (void) const |
| bool | IsActive (void) const |
| bool | IsActiveSelf (void) const |
| void | SetActive (const bool isActive) |
| const ComponentKey & | GetKey (void) const |
| const ComponentTypeKey & | GetTypeKey (void) const |
Static Public Member Functions | |
| template<typename ComponentType > | |
| static ComponentTypeKey | RegisterComponent (void) |
Public Attributes | |
| const Node & | mNode |
Protected Member Functions | |
| Component (Node &node, const ComponentKey &componentKey, const ComponentTypeKey &componentTypeKey) | |
Protected Attributes | |
| Node & | mMutableNode |
Friends | |
| class | Node |
Defines a basic component for all other component types.
2024-10-10: Lets say you wanted to create a Mesh Component. First make; class MeshComponent : Component to new Component class, such as MeshComponent::ComponentTypeKey() (whether named Type or Definition) and in the source file register it like the following in static space, not within a function:
static const auto kMeshComponentRegistration = tbCore::Component::RegisterComponent<tbCore::MeshComponent>();
Generally they should be added when loading a TrackBundle, but there is an argument to be able to create them through an API. I think that API would be on the Node with a templated AddComponent<Type>() which may need to call the Creator using some template magic for ::kTypeKey... forcing the above 'customary' addition.