#include <firstpersoncontroller.h>
Public Member Functions | |
| FirstPersonControllerInstance (EntityInstance &entity, Component &resource) | |
| virtual bool | init (utility::ErrorState &errorState) override |
| virtual void | update (double deltaTime) override |
| void | enable (const glm::vec3 &translate, const glm::quat &rotate) |
| void | enable () |
| void | disable () |
| CameraComponentInstance & | getCameraComponent () |
| float | getMovementSpeed () const |
| void | setMovementSpeed (float speed) |
| float | getRotationSpeed () const |
| void | setRotationSpeed (float speed) |
Public Member Functions inherited from ComponentInstance | |
| 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) |
Public Member Functions inherited from Object | |
| 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 Public Member Functions inherited from Object | |
| static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Public Attributes inherited from Object | |
| std::string | mID |
| Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Instance part of the first person controller. The controller applies first-person movement to the (camera) entity it is attached to. Hold left mouse to activate. WASD to move, QE to move up and down, mouse to rotate. Requires a nap::KeyInputComponent and nap::TransformComponent to be present on the same entity.
| FirstPersonControllerInstance | ( | EntityInstance & | entity, |
| Component & | resource | ||
| ) |
| void disable | ( | ) |
Disables the component.
| void enable | ( | ) |
Enable the component, keeping the current transform.
| void enable | ( | const glm::vec3 & | translate, |
| const glm::quat & | rotate | ||
| ) |
Enable the component while setting the transform.
| translate | Camera translation to set. |
| rotate | Camera rotation to set. |
| CameraComponentInstance& getCameraComponent | ( | ) |
| float getMovementSpeed | ( | ) | const |
| float getRotationSpeed | ( | ) | const |
|
overridevirtual |
Initialize this ComponentInstance
Reimplemented from ComponentInstance.
| void setMovementSpeed | ( | float | speed | ) |
Sets the camera movement speed
| speed | the new movement speed |
| void setRotationSpeed | ( | float | speed | ) |
Sets the current camera rotation speed
| speed | the new camera rotation speed |
|
overridevirtual |
Update this ComponentInstance
Reimplemented from ComponentInstance.