Tramway SDK
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tram::ControllerComponent Class Referenceabstract

Provides an API for character controllers. More...

#include <components/controller.h>

Inheritance diagram for tram::ControllerComponent:
tram::EntityComponent tram::FPSControllerComponent tram::RaycastControllerComponent

Public Member Functions

virtual void Move (vec3 local_direction)=0
 
virtual void Run ()=0
 
virtual void Crouch ()=0
 
virtual void Fly ()=0
 
virtual void Jump ()=0
 
virtual void TurnLeft ()=0
 
virtual void TurnRight ()=0
 
virtual void Push (vec3 direction)=0
 
void SetCollisions (bool collide)
 
void SetLookDirection (quat direction)
 
quat GetLookDirection () const
 
- Public Member Functions inherited from tram::EntityComponent
 EntityComponent ()=default
 
virtual ~EntityComponent ()=default
 
virtual void Init ()
 Initializes an entity component. More...
 
virtual void EventHandler (Event &event)=0
 
bool IsReady ()
 Returns the component's readiness. More...
 
bool IsInit ()
 Returns the component's init status. More...
 
EntityGetParent ()
 
void SetParent (Entity *parent)
 

Static Public Member Functions

static bool IsDebugInfoDraw ()
 
static void SetDebugInfoDraw (bool)
 
static void Update ()
 Updates the ControllerComponents. More...
 

Protected Attributes

quat look_direction = {1.0f, 0.0f, 0.0f, 0.0f}
 
bool collide = true
 
- Protected Attributes inherited from tram::EntityComponent
size_t resources_waiting = 0
 
bool is_ready = false
 
bool is_init = false
 
Entityparent = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from tram::EntityComponent
void ResourceReady ()
 Notifies the component of a streamed-in resource. More...
 
virtual void Start ()=0
 

Detailed Description

Provides an API for character controllers.

See also
https://racenis.github.io/tram-sdk/documentation/components/controller.html

Member Function Documentation

◆ Crouch()

virtual void tram::ControllerComponent::Crouch ( )
pure virtual

◆ Fly()

virtual void tram::ControllerComponent::Fly ( )
pure virtual

◆ GetLookDirection()

quat tram::ControllerComponent::GetLookDirection ( ) const
inline

◆ IsDebugInfoDraw()

bool tram::ControllerComponent::IsDebugInfoDraw ( )
static

◆ Jump()

virtual void tram::ControllerComponent::Jump ( )
pure virtual

◆ Move()

virtual void tram::ControllerComponent::Move ( vec3  local_direction)
pure virtual

◆ Push()

virtual void tram::ControllerComponent::Push ( vec3  direction)
pure virtual

◆ Run()

virtual void tram::ControllerComponent::Run ( )
pure virtual

◆ SetCollisions()

void tram::ControllerComponent::SetCollisions ( bool  collide)
inline

◆ SetDebugInfoDraw()

void tram::ControllerComponent::SetDebugInfoDraw ( bool  draw)
static

◆ SetLookDirection()

void tram::ControllerComponent::SetLookDirection ( quat  direction)
inline

◆ TurnLeft()

virtual void tram::ControllerComponent::TurnLeft ( )
pure virtual

◆ TurnRight()

virtual void tram::ControllerComponent::TurnRight ( )
pure virtual

◆ Update()

void tram::ControllerComponent::Update ( )
static

Updates the ControllerComponents.

Updates all of the ControllerComponents. Should be called once per update cycle. Best place to do so would be before updating any cameras, otherwise they will lag behind the controller for the rest of the frame.

Member Data Documentation

◆ collide

bool tram::ControllerComponent::collide = true
protected

◆ look_direction

quat tram::ControllerComponent::look_direction = {1.0f, 0.0f, 0.0f, 0.0f}
protected

The documentation for this class was generated from the following files: