Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
PhysicsService Class Reference

Service responsible for managing the physics world. More...

#include <physics_service.h>

Inheritance diagram for PhysicsService:
[legend]

Public Member Functions

 PhysicsService ()
 
void update (float dt, const std::vector< std::reference_wrapper< GameObject > > &objects)
 Updates the physics world by stepping the simulation.
 
std::unique_ptr< PhysicsWorld > & world () noexcept
 Accessor for the physics world instance.
 
std::unique_ptr< PhysicsRaycaster > & raycaster () noexcept
 Accessor for the physics raycaster instance.
 
std::unique_ptr< PhysicsCreationFactory > & factory () noexcept
 Accessor for the physics creation factory instance.
 
bool debug_mode () const noexcept
 
void debug_mode (bool enabled) noexcept
 
- Public Member Functions inherited from IEngineService
virtual ~IEngineService ()=default
 

Detailed Description

Service responsible for managing the physics world.

This service encapsulates the physics world and provides functionality to update and interact with the physics simulation.

Constructor & Destructor Documentation

◆ PhysicsService()

PhysicsService::PhysicsService ( )

Member Function Documentation

◆ debug_mode() [1/2]

bool PhysicsService::debug_mode ( ) const
noexcept

◆ debug_mode() [2/2]

void PhysicsService::debug_mode ( bool  enabled)
noexcept

◆ factory()

std::unique_ptr< PhysicsCreationFactory > & PhysicsService::factory ( )
noexcept

Accessor for the physics creation factory instance.

Returns
std::unique_ptr<PhysicsCreationFactory>& Reference to the physics creation factory instance.

◆ raycaster()

std::unique_ptr< PhysicsRaycaster > & PhysicsService::raycaster ( )
noexcept

Accessor for the physics raycaster instance.

Returns
std::unique_ptr<PhysicsRaycaster>& Reference to the physics raycaster instance.

◆ update()

void PhysicsService::update ( float  dt,
const std::vector< std::reference_wrapper< GameObject > > &  objects 
)

Updates the physics world by stepping the simulation.

Note
Delta time (dt) should potentially be fixed for consistent physics behavior.

This method advances the physics simulation by one time step, applying all physics calculations and updating object states.

Parameters
dtThe (deltatime) time step duration for the physics update.
objectsThe list of game objects to check for collisions.

◆ world()

std::unique_ptr< PhysicsWorld > & PhysicsService::world ( )
noexcept

Accessor for the physics world instance.

Returns
std::unique_ptr<PhysicsWorld>& Reference to the physics world instance.

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