#include <component.h>
Public Member Functions | |
ComponentInstance (EntityInstance &entity, Component &resource) | |
virtual void | update (double deltaTime) |
nap::EntityInstance * | getEntityInstance () const |
nap::Component * | getComponent () const |
template<typename T > | |
T * | getComponent () const |
virtual bool | init (utility::ErrorState &errorState) |
virtual bool | init (utility::ErrorState &errorState) |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Runtime version of a Component. Adds behavior to an entity and allows for operations on a per frame basis. Override the init and update methods in derived classes Every runtime version of a component receives on construction the resource it was created from and the entity instance it belongs to.
ComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
Constructor
entity | instance the entity this component instance belongs to |
resource | the resource this component was created from |
nap::Component* getComponent | ( | ) | const |
T * getComponent |
nap::EntityInstance* getEntityInstance | ( | ) | const |
virtual bool init |
Override this method to initialize the object after de-serialization. When called it is safe to assume that all dependencies have been resolved up to this point.
errorState | should contain the error message when initialization fails. |
|
virtual |
Initializes this component based on it's resource.
errorState | contains the error when initialization fails. |
Reimplemented from Object.
Reimplemented in LightComponentInstance, Renderable2DTextComponentInstance, RenderToTextureComponentInstance, RenderableMeshComponentInstance, SequencePlayerAudioOutputComponentInstance, ParameterBlendComponentInstance, PythonScriptComponentInstance, RotateComponentInstance, OrthoCameraComponentInstance, Renderable3DTextComponentInstance, CameraControllerInstance, RenderFaderComponentInstance, ComputeComponentInstance, RenderGnomonComponentInstance, PlaybackComponentInstance, APIComponentInstance, RenderSkyBoxComponentInstance, OrbitControllerInstance, RenderBloomComponentInstance, RenderableTextComponentInstance, RenderFrustumComponentInstance, RenderVideoComponentInstance, LevelMeterComponentInstance, FirstPersonControllerInstance, SpotLightComponentInstance, ArtNetInputComponentInstance, OrthoControllerInstance, OSCInputComponentInstance, WebSocketComponentInstance, OutputComponentInstance, PerspCameraComponentInstance, RenderableComponentInstance, AudioInputComponentInstance, CalendarComponentInstance, MidiInputComponentInstance, PointLightComponentInstance, DirectionalLightComponentInstance, FluxMeasurementComponentInstance, VideoAudioComponentInstance, FFTAudioNodeComponentInstance, TransformComponentInstance, and PortalComponentInstance.
|
virtual |
Update this component
deltaTime | the time in between cooks in seconds |
Reimplemented in ParameterBlendComponentInstance, RotateComponentInstance, RenderFaderComponentInstance, PythonScriptComponentInstance, PlaybackComponentInstance, FirstPersonControllerInstance, CalendarComponentInstance, and FluxMeasurementComponentInstance.