NAP
Public Member Functions | Public Attributes | List of all members
FirstPersonController Class Reference

#include <firstpersoncontroller.h>

Public Member Functions

virtual void getDependentComponents (std::vector< rtti::TypeInfo > &components) const override
 
- Public Member Functions inherited from Component
virtual const rtti::TypeInfo getInstanceType () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

float mMovementSpeed = 3.0f
 Property: "MovementSpeed" The speed with which to move. More...
 
float mRotateSpeed = 1.0f
 Property: "RotateSpeed" The speed with which to rotate. More...
 
ComponentPtr< nap::PerspCameraComponentmPerspCameraComponent
 Property: "PerspCameraComponent" Camera that we're controlling. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Resource part of the first person 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.

Inheritance diagram for FirstPersonController:
[legend]
Collaboration diagram for FirstPersonController:
[legend]

Member Function Documentation

◆ getDependentComponents()

virtual void getDependentComponents ( std::vector< rtti::TypeInfo > &  components) const
overridevirtual

Get the types of components on which this component depends

Reimplemented from Component.

Member Data Documentation

◆ mMovementSpeed

float mMovementSpeed = 3.0f

Property: "MovementSpeed" The speed with which to move.

◆ mPerspCameraComponent

ComponentPtr<nap::PerspCameraComponent> mPerspCameraComponent

Property: "PerspCameraComponent" Camera that we're controlling.

◆ mRotateSpeed

float mRotateSpeed = 1.0f

Property: "RotateSpeed" The speed with which to rotate.