TheAtlasEngine
 
Loading...
Searching...
No Matches
atlas::physics::jolt_context Class Reference

jolt_context is the backend implementation of physics context More...

#include <jolt_context.hpp>

Inheritance diagram for atlas::physics::jolt_context:
atlas::physics::physics_context

Public Member Functions

 jolt_context (const jolt_settings &p_settings, event::event_bus &p_bus)
 construct a new physics context with jolt implemented as its backend
 
- Public Member Functions inherited from atlas::physics::physics_context
void destroy ()
 Performs cleanup when simulation stops.
 
void update (float p_delta_time)
 updates our simulation using delta time and works with a fixed timestep
 
void prepare ()
 As soon all physics bodies/colliders are created.
 
void add_box_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const box_collider *p_collider)
 
void add_sphere_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const sphere_collider *p_collider)
 
void add_capsule_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const capsule_collider *p_collider)
 
transform read_transform (uint32_t p_id)
 
physics_body read_physics_body (uint32_t p_id)
 
void set_linear_velocity (uint64_t p_id, const glm::vec3 &p_linear_velocity)
 
void set_angular_velocity (uint64_t p_id, const glm::vec3 &p_angular_velocity)
 
void set_force (uint64_t p_id, const glm::vec3 &p_force)
 
void set_force_and_torque (uint64_t p_id, const glm::vec3 &p_force, const glm::vec3 &p_torque)
 
void set_impulse (uint64_t p_id, const glm::vec3 &p_impulse)
 

Protected Member Functions

void emplace_box_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const box_collider *p_collider) override
 Any emplace_* specific function are specific collider implementation-specific to the backend (context) API's they are implemented with.
 
void emplace_sphere_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const sphere_collider *p_collider) override
 
void emplace_capsule_collider (uint32_t p_entity_id, const transform *p_transform, const physics_body *p_body, const capsule_collider *p_collider) override
 
transform context_read_transform (uint32_t p_id) override
 
physics_body context_read_physics_body (uint32_t p_id) override
 
void linear_velocity (uint64_t p_id, const glm::vec3 &p_linear_velocity) override
 
void angular_velocity (uint64_t p_id, const glm::vec3 &p_angular_velocity) override
 
void force (uint64_t p_id, const glm::vec3 &p_cumulative_force) override
 
void add_force_and_torque (uint64_t p_id, const glm::vec3 &p_force, const glm::vec3 &p_torque) override
 
void add_impulse (uint64_t p_id, const glm::vec3 &p_impulse) override
 

Private Member Functions

void destroy_bodies () override
 Performs any specific cleanup needed by Jolt.
 

Detailed Description

jolt_context is the backend implementation of physics context

This is the jolt specific implementation of the physics context

Represents the external abstraction that is defined through the the engine-specific parameters.

Constructor & Destructor Documentation

◆ jolt_context()

atlas::physics::jolt_context::jolt_context ( const jolt_settings p_settings,
event::event_bus p_bus 
)

construct a new physics context with jolt implemented as its backend

Parameters
p_settingsare the configuration parameters for initiating JoltPhysics
p_busis the event::bus that allows for publishing physics events to the subscribers of those said events

Member Function Documentation

◆ add_force_and_torque()

void atlas::physics::jolt_context::add_force_and_torque ( uint64_t  p_id,
const glm::vec3 &  p_force,
const glm::vec3 &  p_torque 
)
overrideprotectedvirtual

◆ add_impulse()

void atlas::physics::jolt_context::add_impulse ( uint64_t  p_id,
const glm::vec3 &  p_impulse 
)
overrideprotectedvirtual

◆ angular_velocity()

void atlas::physics::jolt_context::angular_velocity ( uint64_t  p_id,
const glm::vec3 &  p_angular_velocity 
)
overrideprotectedvirtual

◆ context_read_physics_body()

physics_body atlas::physics::jolt_context::context_read_physics_body ( uint32_t  p_id)
overrideprotectedvirtual

◆ context_read_transform()

transform atlas::physics::jolt_context::context_read_transform ( uint32_t  p_id)
overrideprotectedvirtual

◆ destroy_bodies()

void atlas::physics::jolt_context::destroy_bodies ( )
overrideprivatevirtual

Performs any specific cleanup needed by Jolt.

Implements atlas::physics::physics_context.

◆ emplace_box_collider()

void atlas::physics::jolt_context::emplace_box_collider ( uint32_t  p_entity_id,
const transform p_transform,
const physics_body p_body,
const box_collider p_collider 
)
overrideprotectedvirtual

Any emplace_* specific function are specific collider implementation-specific to the backend (context) API's they are implemented with.

Since colliders have specific parameters that define them. It would simplify what parameter-access they have when adding these specific colliders to the physics system

Implements atlas::physics::physics_context.

◆ emplace_capsule_collider()

void atlas::physics::jolt_context::emplace_capsule_collider ( uint32_t  p_entity_id,
const transform p_transform,
const physics_body p_body,
const capsule_collider p_collider 
)
overrideprotectedvirtual

◆ emplace_sphere_collider()

void atlas::physics::jolt_context::emplace_sphere_collider ( uint32_t  p_entity_id,
const transform p_transform,
const physics_body p_body,
const sphere_collider p_collider 
)
overrideprotectedvirtual

◆ force()

void atlas::physics::jolt_context::force ( uint64_t  p_id,
const glm::vec3 &  p_cumulative_force 
)
overrideprotectedvirtual

◆ linear_velocity()

void atlas::physics::jolt_context::linear_velocity ( uint64_t  p_id,
const glm::vec3 &  p_linear_velocity 
)
overrideprotectedvirtual

◆ prepare_and_finalize()

void atlas::physics::jolt_context::prepare_and_finalize ( )
overrideprivatevirtual

◆ update_simulation()

void atlas::physics::jolt_context::update_simulation ( float  p_delta_time)
overrideprivatevirtual

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