tec::PhysicsSystem

#include <physics-system.hpp>

Inherits from tec::CommandQueue< PhysicsSystem >, tec::EventQueue< MouseBtnEvent >, tec::EventQueue< EntityCreated >, tec::EventQueue< EntityDestroyed >

Public Functions

Name
PhysicsSystem()
~PhysicsSystem()
void SetSubstepping(int substep)
std::set< eid > Update(const double delta, const GameState & state)
eid RayCastMousePick(eid source_entity, double mouse_x =0.0f, double mouse_y =0.0f, float screen_width =1.0f, float screen_height =1.0f)
eid RayCastIgnore(eid source_entity, eid ignore_entity)
glm::vec3 GetLastRayPos() const
double GetLastRayDistance() const
void RaySetInvalid()
void DebugDraw()
virtual void On(eid , std::shared_ptr< MouseBtnEvent > data) override
virtual void On(eid , std::shared_ptr< EntityCreated > data) override
virtual void On(eid entity_id, std::shared_ptr< EntityDestroyed > data) override
Position GetPosition(eid entity_id)
Orientation GetOrientation(eid entity_id)

Protected Functions

Name
void SetGravity(const unsigned int entity_id, const btVector3 & f)
Set a rigid body's gravity.
void SetNormalGravity(const unsigned int entity_id)
Set a rigid body's gravity to the world's gravity.

Additional inherited members

Public Functions inherited from tec::CommandQueue< PhysicsSystem >

Name
CommandQueue()
~CommandQueue()
void ProcessCommandQueue()
void QueueCommand(Command< T > && command)
void QueueCommand(std::function< void(T *)> && command)

Protected Attributes inherited from tec::CommandQueue< PhysicsSystem >

Name
std::atomic< std::queue< Command< T > > * > global_command_queue
std::queue< Command< T > > * local_queue

Public Functions inherited from tec::EventQueue< MouseBtnEvent >

Name
EventQueue()
EventQueue(eid entity_id)
virtual ~EventQueue()
void ProcessEventQueue()
void QueueEvent(Event< T > && e)

Protected Attributes inherited from tec::EventQueue< MouseBtnEvent >

Name
Queue< Event< T > > * read_event_queue
std::atomic< Queue< Event< T > > * > write_event_queue

Public Functions inherited from tec::EventQueue< EntityCreated >

Name
EventQueue()
EventQueue(eid entity_id)
virtual ~EventQueue()
void ProcessEventQueue()
void QueueEvent(Event< T > && e)

Protected Attributes inherited from tec::EventQueue< EntityCreated >

Name
Queue< Event< T > > * read_event_queue
std::atomic< Queue< Event< T > > * > write_event_queue

Public Functions inherited from tec::EventQueue< EntityDestroyed >

Name
EventQueue()
EventQueue(eid entity_id)
virtual ~EventQueue()
void ProcessEventQueue()
void QueueEvent(Event< T > && e)

Protected Attributes inherited from tec::EventQueue< EntityDestroyed >

Name
Queue< Event< T > > * read_event_queue
std::atomic< Queue< Event< T > > * > write_event_queue

Public Functions Documentation

function PhysicsSystem

PhysicsSystem()

function ~PhysicsSystem

~PhysicsSystem()

function SetSubstepping

inline void SetSubstepping(
    int substep
)

function Update

std::set< eid > Update(
    const double delta,
    const GameState & state
)

function RayCastMousePick

eid RayCastMousePick(
    eid source_entity,
    double mouse_x =0.0f,
    double mouse_y =0.0f,
    float screen_width =1.0f,
    float screen_height =1.0f
)

function RayCastIgnore

eid RayCastIgnore(
    eid source_entity,
    eid ignore_entity
)

function GetLastRayPos

inline glm::vec3 GetLastRayPos() const

function GetLastRayDistance

inline double GetLastRayDistance() const

function RaySetInvalid

inline void RaySetInvalid()

function DebugDraw

void DebugDraw()

function On

virtual void On(
    eid ,
    std::shared_ptr< MouseBtnEvent > data
) override

Reimplements: tec::EventQueue::On

function On

virtual void On(
    eid ,
    std::shared_ptr< EntityCreated > data
) override

Reimplements: tec::EventQueue::On

function On

virtual void On(
    eid entity_id,
    std::shared_ptr< EntityDestroyed > data
) override

Reimplements: tec::EventQueue::On

function GetPosition

Position GetPosition(
    eid entity_id
)

function GetOrientation

Orientation GetOrientation(
    eid entity_id
)

Protected Functions Documentation

function SetGravity

void SetGravity(
    const unsigned int entity_id,
    const btVector3 & f
)

Set a rigid body's gravity.

Parameters:

  • const unsigned int entity_id The entity ID of the rigid body.
  • btVector3 f The rigid body's new gravity.

function SetNormalGravity

void SetNormalGravity(
    const unsigned int entity_id
)

Set a rigid body's gravity to the world's gravity.

Parameters:

  • const unsigned int entity_id The entity ID of the rigid body.

Updated on 2022-07-24 at 19:27:35 +0000