Tramway SDK
Public Member Functions | List of all members
tram::TriggerComponent Class Reference

#include <trigger.h>

Inheritance diagram for tram::TriggerComponent:
tram::EntityComponent

Public Member Functions

 TriggerComponent ()
 
 ~TriggerComponent ()
 
void EventHandler (Event &event)
 
void Start ()
 
Physics::CollisionModelGetModel ()
 
void SetModel (name_t model)
 
void SetModel (Physics::CollisionModel *model)
 
void SetShape (Physics::CollisionShape shape)
 Sets a collision shape for the trigger. More...
 
void SetActivationCallback (void(*activation_callback)(TriggerComponent *, Physics::Collision))
 
void SetDectivationCallback (void(*deactivation_callback)(TriggerComponent *, Physics::Collision))
 
void SetFilterCallback (bool(*filter_callback)(TriggerComponent *, PhysicsComponent *))
 
void SetCollisionMask (uint32_t flags)
 Sets a collision mask for the trigger. More...
 
void SetCollisionGroup (uint32_t flags)
 Sets a collision group for the trigger. More...
 
void SetStoreCollisions (bool store_collisions)
 
uint32_t GetCollisionMask ()
 
uint32_t GetCollisionGroup ()
 
void SetLocation (vec3 location)
 Sets the location of the component. More...
 
void SetRotation (quat rotation)
 Sets the rotation of the component. More...
 
const std::vector< Physics::Collision > & GetStoredCollisions ()
 
void Collision (const Physics::Collision &collision)
 Registers a collision. More...
 
void ResetCollisions ()
 Resets registered collisions. More...
 
std::vector< Physics::CollisionPoll ()
 Checks for collisions with the trigger. More...
 
- Public Member Functions inherited from tram::EntityComponent
 EntityComponent ()
 
virtual ~EntityComponent ()
 
virtual void Init ()
 
bool IsReady ()
 
bool IsInit ()
 
EntityGetParent ()
 
void SetParent (Entity *parent)
 

Additional Inherited Members

- Protected Member Functions inherited from tram::EntityComponent
void ResourceReady ()
 
- Protected Attributes inherited from tram::EntityComponent
size_t resources_waiting = 0
 
bool is_ready = false
 
bool is_init = false
 
Entityparent = nullptr
 

Constructor & Destructor Documentation

◆ TriggerComponent()

tram::TriggerComponent::TriggerComponent ( )
inline

◆ ~TriggerComponent()

tram::TriggerComponent::~TriggerComponent ( )

Member Function Documentation

◆ Collision()

void tram::TriggerComponent::Collision ( const Physics::Collision collision)

Registers a collision.

This method is called from Phyics::Update().

◆ EventHandler()

void tram::TriggerComponent::EventHandler ( Event event)
inlinevirtual

Implements tram::EntityComponent.

◆ GetCollisionGroup()

uint32_t tram::TriggerComponent::GetCollisionGroup ( )
inline

◆ GetCollisionMask()

uint32_t tram::TriggerComponent::GetCollisionMask ( )
inline

◆ GetModel()

Physics::CollisionModel * tram::TriggerComponent::GetModel ( )
inline

◆ GetStoredCollisions()

const std::vector< Physics::Collision > & tram::TriggerComponent::GetStoredCollisions ( )
inline

◆ Poll()

std::vector< Physics::Collision > tram::TriggerComponent::Poll ( )

Checks for collisions with the trigger.

◆ ResetCollisions()

void tram::TriggerComponent::ResetCollisions ( )

Resets registered collisions.

This method is called from Phyics::Update().

◆ SetActivationCallback()

void tram::TriggerComponent::SetActivationCallback ( void(*)(TriggerComponent *, Physics::Collision activation_callback)
inline

◆ SetCollisionGroup()

void tram::TriggerComponent::SetCollisionGroup ( uint32_t  flags)

Sets a collision group for the trigger.

This method works the same as in PhysicsComponent, see PhysicsComponent::SetCollisionGroup() for more information.

◆ SetCollisionMask()

void tram::TriggerComponent::SetCollisionMask ( uint32_t  flags)

Sets a collision mask for the trigger.

This method works the same as in PhysicsComponent, see PhysicsComponent::SetCollsionMask() for more information.

◆ SetDectivationCallback()

void tram::TriggerComponent::SetDectivationCallback ( void(*)(TriggerComponent *, Physics::Collision deactivation_callback)
inline

◆ SetFilterCallback()

void tram::TriggerComponent::SetFilterCallback ( bool(*)(TriggerComponent *, PhysicsComponent *)  filter_callback)
inline

◆ SetLocation()

void tram::TriggerComponent::SetLocation ( vec3  location)

Sets the location of the component.

◆ SetModel() [1/2]

void tram::TriggerComponent::SetModel ( name_t  model)
inline

◆ SetModel() [2/2]

void tram::TriggerComponent::SetModel ( Physics::CollisionModel model)
inline

◆ SetRotation()

void tram::TriggerComponent::SetRotation ( quat  rotation)

Sets the rotation of the component.

◆ SetShape()

void tram::TriggerComponent::SetShape ( Physics::CollisionShape  shape)

Sets a collision shape for the trigger.

◆ SetStoreCollisions()

void tram::TriggerComponent::SetStoreCollisions ( bool  store_collisions)
inline

◆ Start()

void tram::TriggerComponent::Start ( )
virtual

Implements tram::EntityComponent.


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