StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Physics::PhysicsSystem Class Reference

Core physics simulation system. More...

#include <physics/PhysicsSystem.hpp>

Public Member Functions

 PhysicsSystem ()
 Create physics system.
 
void Init (JPH::PhysicsSettings settings)
 Initialize physics system.
 
RigidBodyCastRay (JPH::RayCast ray, Utilities::Vector3 *hitPoint=NULL) const
 Get physics body interface.
 
JPH::PhysicsSystem & GetJoltSystem ()
 Get Jolt physics system.
 
JPH::Body * CreateBody (JPH::BodyCreationSettings settings, RigidBody *attachedRigidBody)
 Create a new Jolt physics body.
 
void DestroyBody (JPH::Body *body, RigidBody *attachedRigidBody)
 Destroy body.
 

Friends

class StevEngine::Engine
 

Detailed Description

Core physics simulation system.

Handles initialization and updating of the Jolt physics engine. Manages physics settings, bodies, and simulation state.

Member Function Documentation

◆ CastRay()

RigidBody * StevEngine::Physics::PhysicsSystem::CastRay ( JPH::RayCast ray,
Utilities::Vector3 * hitPoint = NULL ) const

Get physics body interface.

Parameters
rayJolt ray to cast
hitPoint[OUT] Point of ray intersect
Returns
If successfully hit a pointer to the RigidBody component that was hit otherwise nullptr

◆ CreateBody()

JPH::Body * StevEngine::Physics::PhysicsSystem::CreateBody ( JPH::BodyCreationSettings settings,
RigidBody * attachedRigidBody )

Create a new Jolt physics body.

Parameters
settingsJolt physics body creation settings
attachedRigidBodyThe rigid body component attached to this body
Returns
Newly created body

◆ DestroyBody()

void StevEngine::Physics::PhysicsSystem::DestroyBody ( JPH::Body * body,
RigidBody * attachedRigidBody )

Destroy body.

Parameters
bodyBody to destroy
attachedRigidBodyThe rigid body component attached to this body

◆ GetJoltSystem()

JPH::PhysicsSystem & StevEngine::Physics::PhysicsSystem::GetJoltSystem ( )
inline

Get Jolt physics system.

Returns
Reference to Jolt physics system

◆ Init()

void StevEngine::Physics::PhysicsSystem::Init ( JPH::PhysicsSettings settings)

Initialize physics system.

Parameters
settingsJolt physics settings

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