R-Type 0.1
Loading...
Searching...
No Matches
rtk::systems::DebugCollisionSystem Class Referencefinal

Draws collider outlines while the debug overlay is enabled. More...

#include <systems/DebugCollisionSystem.hpp>

Inheritance diagram for rtk::systems::DebugCollisionSystem:
[legend]

Public Member Functions

 DebugCollisionSystem (const rtk::collision::CollisionBuffer &collisionBuffer, rtk::RenderWindow &window, const rtk::InputState &inputState)
 Creates the system.
 
void onStart (rtk::ecs::Registry &) override
 Creates the 1x1 white texture used to draw outlines.
 
void update (rtk::ecs::Registry &registry, float) override
 Updates one outline entity per collider edge.
 
void onStop (rtk::ecs::Registry &registry) override
 Destroys the outline entities.
 

Detailed Description

Draws collider outlines while the debug overlay is enabled.

Outlines of colliding entities are red, the others are green.

Constructor & Destructor Documentation

◆ DebugCollisionSystem()

rtk::systems::DebugCollisionSystem::DebugCollisionSystem ( const rtk::collision::CollisionBuffer & collisionBuffer,
rtk::RenderWindow & window,
const rtk::InputState & inputState )
inlineexplicit

Creates the system.

Parameters
collisionBufferCollisions of the current frame.
windowWindow used to create the outline texture.
inputStateInput state holding the debug toggle.

Member Function Documentation

◆ update()

void rtk::systems::DebugCollisionSystem::update ( rtk::ecs::Registry & registry,
float  )
inlineoverride

Updates one outline entity per collider edge.

Parameters
registryRegistry holding the colliders.

◆ onStop()

void rtk::systems::DebugCollisionSystem::onStop ( rtk::ecs::Registry & registry)
inlineoverride

Destroys the outline entities.

Parameters
registryRegistry holding the outlines.