Static utility class handling AABB collisions, velocity integration, and DDA raycasting.
More...
#include <src/physics/PhysicsSystem.h>
|
| 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 utility class handling AABB collisions, velocity integration, and DDA raycasting.
◆ checkCollision()
| bool PhysicsSystem::checkCollision |
( |
const AABB & |
objAABB, |
|
|
const ChunkManager & |
objChunkManager |
|
) |
| |
|
staticprivate |
◆ lerp()
| static float PhysicsSystem::lerp |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
t |
|
) |
| |
|
inlinestaticprivate |
◆ RayCast()
Performs a DDA Raycast to find the first block hit.
- Parameters
-
| objRay | The properties of the Ray (Input:Direction & Output: Found a hit or not, Hit point, Distance & Block Pos(X, Y & Z)). |
- Parameters
-
| fMaxDistance | Maximum distance that the ray can travel in space. |
- Parameters
-
| objChunkManager | World data for collision checks. |
◆ Update()
| void PhysicsSystem::Update |
( |
RigidBody & |
objRigidBody, |
|
|
float |
fDeltaTime, |
|
|
const ChunkManager & |
objChunkManager, |
|
|
bool |
bFlyMode = false |
|
) |
| |
|
static |
Updates physics (Gravity, Friction, Velocity).
- Parameters
-
| objRigidBody | The body to update. |
| fDeltaTime | Time since last frame. |
| objChunkManager | World data for collision checks. |
| bFlyMode | If true, disables gravity. |
The documentation for this class was generated from the following files: