HPC_Voxel_Engine 0.2.0
High-Performance C++ Voxel Engine
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Member Functions | List of all members
PhysicsSystem Class Reference

Static utility class handling AABB collisions, velocity integration, and DDA raycasting. More...

#include <src/physics/PhysicsSystem.h>

Collaboration diagram for PhysicsSystem:
Collaboration graph

Static Public Member Functions

static void Update (RigidBody &objRigidBody, float fDeltaTime, const ChunkManager &objChunkManager, bool bFlyMode=false)
 Updates physics (Gravity, Friction, Velocity).
 
static RayHit RayCast (const Core::Ray &objRay, float fMaxDistance, const ChunkManager &objChunkManager)
 Performs a DDA Raycast to find the first block hit.
 

Static Private Member Functions

static bool checkCollision (const AABB &objAABB, const ChunkManager &objChunkManager)
 
static float lerp (float a, float b, float t)
 

Detailed Description

Static utility class handling AABB collisions, velocity integration, and DDA raycasting.

Member Function Documentation

◆ checkCollision()

bool PhysicsSystem::checkCollision ( const AABB objAABB,
const ChunkManager objChunkManager 
)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lerp()

static float PhysicsSystem::lerp ( float  a,
float  b,
float  t 
)
inlinestaticprivate
Here is the caller graph for this function:

◆ RayCast()

RayHit PhysicsSystem::RayCast ( const Core::Ray objRay,
float  fMaxDistance,
const ChunkManager objChunkManager 
)
static

Performs a DDA Raycast to find the first block hit.

  • Parameters
    objRayThe properties of the Ray (Input:Direction & Output: Found a hit or not, Hit point, Distance & Block Pos(X, Y & Z)).
  • Parameters
    fMaxDistanceMaximum distance that the ray can travel in space.
  • Parameters
    objChunkManagerWorld data for collision checks.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update()

void PhysicsSystem::Update ( RigidBody objRigidBody,
float  fDeltaTime,
const ChunkManager objChunkManager,
bool  bFlyMode = false 
)
static

Updates physics (Gravity, Friction, Velocity).

Parameters
objRigidBodyThe body to update.
fDeltaTimeTime since last frame.
objChunkManagerWorld data for collision checks.
bFlyModeIf true, disables gravity.
Here is the call graph for this function:
Here is the caller graph for this function:

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