Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Public Member Functions | Friends | List of all members
Engine::CollisionSystem Class Reference

The Collision System handles and stores run-time collision data using the Box2D library More...

#include <CollisionSystem.hpp>

Public Member Functions

 ~CollisionSystem ()
 
void Stop ()
 Stops the Collision System, emptying m_collisionComponents Prevents further calls to Update(). More...
 
void Start ()
 Starts the Collision System, gathering all required component data and generating collision bodies from it. Allows further calls to Update(). More...
 
void Update ()
 Updates the collision world. Takes transform data of collision components, changes it, and replaces the old transform data with the new data. More...
 
eastl::weak_ptr< EntityRayQueryFirstHit (const glm::vec2 &start, const glm::vec2 &end, CollisionLayer detectionLayers) const
 Returns the first collision-body hit by the ray. TODO - Implementation More...
 
eastl::weak_ptr< EntityRayQueryAllHit (const glm::vec2 &start, const glm::vec2 &end) const
 Returns all collision-objects hit by the ray. TODO - Implementation More...
 
bool IsRunning () const
 Returns true if the Collision system is running More...
 
eastl::vector< eastl::weak_ptr< CollisionComponent > > GetActiveCollisionComponents () const
 Gets all of the collision components that are currently active in the world. More...
 

Friends

class Engine
 
class CollisionComponent
 

Detailed Description

The Collision System handles and stores run-time collision data using the Box2D library

Definition at line 22 of file CollisionSystem.hpp.

Constructor & Destructor Documentation

Engine::CollisionSystem::~CollisionSystem ( )

Definition at line 18 of file CollisionSystem.cpp.

Member Function Documentation

eastl::vector< eastl::weak_ptr< CollisionComponent > > Engine::CollisionSystem::GetActiveCollisionComponents ( ) const

Gets all of the collision components that are currently active in the world.

Returns
std::vector of weak pointers of collision components

Definition at line 136 of file CollisionSystem.cpp.

bool Engine::CollisionSystem::IsRunning ( ) const

Returns true if the Collision system is running

Returns
bool that represents wheter or not the collision system is running.

Definition at line 131 of file CollisionSystem.cpp.

eastl::weak_ptr< Entity > Engine::CollisionSystem::RayQueryAllHit ( const glm::vec2 &  start,
const glm::vec2 &  end 
) const

Returns all collision-objects hit by the ray. TODO - Implementation

Parameters
startThe start position of the ray.
endThe end position of the ray.
Returns
vector of shared_ptr of CollisionComponent of all collision-bodies hit by the ray

Definition at line 126 of file CollisionSystem.cpp.

eastl::weak_ptr< Entity > Engine::CollisionSystem::RayQueryFirstHit ( const glm::vec2 &  start,
const glm::vec2 &  end,
CollisionLayer  detectionLayers 
) const

Returns the first collision-body hit by the ray. TODO - Implementation

Parameters
startThe start position of the ray.
endThe end position of the ray.
detectionLayersThe collision layers you want to use.
Returns
shared_ptr of CollisionComponent of the first collision-body hit by the ray.

Definition at line 109 of file CollisionSystem.cpp.

void Engine::CollisionSystem::Start ( )

Starts the Collision System, gathering all required component data and generating collision bodies from it. Allows further calls to Update().

Definition at line 65 of file CollisionSystem.cpp.

void Engine::CollisionSystem::Stop ( )

Stops the Collision System, emptying m_collisionComponents Prevents further calls to Update().

Definition at line 59 of file CollisionSystem.cpp.

void Engine::CollisionSystem::Update ( )

Updates the collision world. Takes transform data of collision components, changes it, and replaces the old transform data with the new data.

Definition at line 71 of file CollisionSystem.cpp.

Friends And Related Function Documentation

friend class CollisionComponent
friend

Definition at line 32 of file CollisionSystem.hpp.

friend class Engine
friend

Definition at line 24 of file CollisionSystem.hpp.


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