#include <rotatecomponent.h>
Public Member Functions | |
RotateComponentInstance (EntityInstance &entity, Component &resource) | |
virtual bool | init (utility::ErrorState &errorState) override |
virtual void | update (double deltaTime) override |
void | reset () |
void | enable (bool enable) |
bool | isEnabled () const |
void | setSpeed (float speed) |
float | getSpeed () const |
void | setAxis (const glm::vec3 &axis) |
glm::vec3 | getAxis () const |
![]() | |
ComponentInstance (EntityInstance &entity, Component &resource) | |
nap::EntityInstance * | getEntityInstance () const |
nap::Component * | getComponent () const |
template<typename T > | |
T * | getComponent () const |
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 |
Public Attributes | |
RotateProperties | mProperties |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Instance part of the rotate component. Automatically rotates the entity along a certain axis at a certain speed. The initial rotation value after initialization is used to rotate along the specified axis. This component updates (overrides) the rotate value of the transform component. Entities that use this component must have a transform.
RotateComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
void enable | ( | bool | enable | ) |
Enable or disable the rotation
glm::vec3 getAxis | ( | ) | const |
float getSpeed | ( | ) | const |
|
overridevirtual |
Initialize this rotate component, copies it's members over and validates if a transform component is available that can be rotated.
errorState | contains the error if initialization fails. |
Reimplemented from ComponentInstance.
bool isEnabled | ( | ) | const |
void reset | ( | ) |
Resets rotation to be 0
void setAxis | ( | const glm::vec3 & | axis | ) |
Sets the rotation axis
axis | rotation axis |
void setSpeed | ( | float | speed | ) |
|
overridevirtual |
Rotates the component based on the current speed and axis
deltaTime | frame time in seconds |
Reimplemented from ComponentInstance.
RotateProperties mProperties |