Antkeeper  0.0.1
Public Member Functions | List of all members
collision_system Class Reference

Maintains a spatially partitioned set of collision meshes. More...

#include <collision-system.hpp>

Inheritance diagram for collision_system:
updatable_system

Public Member Functions

 collision_system (entity::registry &registry)
 
 ~collision_system ()
 
virtual void update (float t, float dt)
 Perform's a system's update() function. More...
 
entity::id pick_nearest (const geom::ray< float, 3 > &ray, std::uint32_t flags) const
 Picks the nearest entity with the specified picking flags that intersects a ray. More...
 
entity::id pick_nearest (const math::fvec3 &origin, const math::fvec3 &normal, std::uint32_t flags) const
 Picks the nearest entity with the specified picking flags that has a non-negative distance from a plane. More...
 
- Public Member Functions inherited from updatable_system
 updatable_system (entity::registry &registry)
 Creates an updatable system. More...
 

Additional Inherited Members

- Protected Attributes inherited from updatable_system
entity::registryregistry
 Registry on which the system operate. More...
 

Detailed Description

Maintains a spatially partitioned set of collision meshes.

Definition at line 31 of file collision-system.hpp.

Constructor & Destructor Documentation

◆ collision_system()

collision_system::collision_system ( entity::registry registry)
explicit

Definition at line 29 of file collision-system.cpp.

◆ ~collision_system()

collision_system::~collision_system ( )

Definition at line 34 of file collision-system.cpp.

Member Function Documentation

◆ pick_nearest() [1/2]

entity::id collision_system::pick_nearest ( const geom::ray< float, 3 > &  ray,
std::uint32_t  flags 
) const

Picks the nearest entity with the specified picking flags that intersects a ray.

Parameters
rayPicking ray.
flagsPicking flags.
Returns
ID of the picked entity, or entt::null if no entity was picked.

Definition at line 43 of file collision-system.cpp.

◆ pick_nearest() [2/2]

entity::id collision_system::pick_nearest ( const math::fvec3 origin,
const math::fvec3 normal,
std::uint32_t  flags 
) const

Picks the nearest entity with the specified picking flags that has a non-negative distance from a plane.

Parameters
originOrigin of the picking plane.
normalPicking plane normal direction.
flagsPicking flags.
Returns
ID of the picked entity, or entt::null if no entity was picked.

Definition at line 83 of file collision-system.cpp.

◆ update()

void collision_system::update ( float  t,
float  dt 
)
virtual

Perform's a system's update() function.

Parameters
tTotal elapsed time, in seconds.
dtDelta time, in seconds.

Implements updatable_system.

Definition at line 38 of file collision-system.cpp.


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