group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
Forces.cpp File Reference

Implementation of the force / impulse / torque API. More...

#include "ecs/physics/Forces.hpp"
#include "ecs/components/Orientation.hpp"
#include "ecs/components/Position.hpp"
#include "ecs/components/RigidBody.hpp"
#include "ecs/components/Velocity.hpp"
#include <glm/gtc/quaternion.hpp>
#include <glm/mat3x3.hpp>
Include dependency graph for Forces.cpp:

Namespaces

namespace  physics
 Pure physics math — no ECS types, no registry.
namespace  physics::forces

Functions

void physics::forces::applyImpulse (Registry &registry, entt::entity entity, glm::vec3 impulse) noexcept
 Apply an instantaneous impulse (units: kg·m/s) at the entity's centre-of-mass.
void physics::forces::applyForce (Registry &registry, entt::entity entity, glm::vec3 force) noexcept
 Apply a continuous force (units: kg·m/s²) at the entity's centre.
void physics::forces::applyImpulseAtPoint (Registry &registry, entt::entity entity, glm::vec3 impulse, glm::vec3 worldPoint) noexcept
 Apply an off-centre impulse.
void physics::forces::applyForceAtPoint (Registry &registry, entt::entity entity, glm::vec3 force, glm::vec3 worldPoint) noexcept
 Apply an off-centre continuous force.
void physics::forces::applyTorque (Registry &registry, entt::entity entity, glm::vec3 torque) noexcept
 Apply a torque (Phase 7). No-op for entities without a RigidBody.
void physics::forces::integrateAccumulators (Registry &registry, float dt) noexcept
 Drain every entity's force / impulse accumulators into its velocity (and, in Phase 7, angular velocity).

Detailed Description

Implementation of the force / impulse / torque API.