Overload  1.1
Game engine with editor
Public Member Functions | List of all members
OvPhysics::Core::PhysicsEngine Class Reference

#include <PhysicsEngine.h>

Public Member Functions

 PhysicsEngine (const Settings::PhysicsSettings &p_settings)
bool Update (float p_deltaTime)
std::optional< Entities::RaycastHitRaycast (OvMaths::FVector3 p_origin, OvMaths::FVector3 p_direction, float p_distance)
void SetGravity (const OvMaths::FVector3 &p_gravity)
OvMaths::FVector3 GetGravity () const

Detailed Description

Main class of OvPhysics, it handles the creation of the physical world. It must be created before any PhysicalObject to ensure PhysicalObject consideration

Constructor & Destructor Documentation

◆ PhysicsEngine()

OvPhysics::Core::PhysicsEngine::PhysicsEngine ( const Settings::PhysicsSettings p_settings)

Creates the PhysicsEngine


Member Function Documentation

◆ GetGravity()

OvMaths::FVector3 OvPhysics::Core::PhysicsEngine::GetGravity ( ) const

Returns the current world gravity

◆ Raycast()

std::optional< RaycastHit > OvPhysics::Core::PhysicsEngine::Raycast ( OvMaths::FVector3  p_origin,
OvMaths::FVector3  p_direction,
float  p_distance 

◆ SetGravity()

void OvPhysics::Core::PhysicsEngine::SetGravity ( const OvMaths::FVector3 p_gravity)

Defines the world gravity to apply


◆ Update()

bool OvPhysics::Core::PhysicsEngine::Update ( float  p_deltaTime)

Simulate the physics. This method call is decomposed in 3 things:

  • Pre-Update (Apply FTransforms to btTransforms, called every Update call)
  • Simulation (Simulate the physics, called 60 times per seconds)
  • Post-Update (Apply the simulation results, btTransforms, to FTransforms) This methods returns true if the call invoked a physics simulation

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