vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::PhysicsSystem Class Reference

Fixed-step rigid-body dynamics: integrates, resolves pairwise collisions, writes poses back. More...

#include <physics_system.h>

Inheritance diagram for Vkm::Engine::PhysicsSystem:
Vkm::Engine::System

Public Member Functions

void fixedUpdate (FrameContext &ctx) override
 Execute this system at the fixed simulation rate.
bool isReplayed () const override
 Re-run during a replay: it moves the world from state and command, deterministically.
Public Member Functions inherited from Vkm::Engine::System
virtual void init (FrameContext &ctx)
 Called once after all systems are registered, before the first update.
virtual void shutdown ()
 Called once on engine shutdown.
virtual void update (FrameContext &ctx)
 Execute this system for the current frame.

Detailed Description

Fixed-step rigid-body dynamics: integrates, resolves pairwise collisions, writes poses back.

Runs on the tick in SystemStage::Simulation, ahead of HierarchySystem, so the Transforms it writes reach WorldTransform the same frame. Enqueues CollisionEvent / TriggerEvent as contacts begin, last and end, on live ticks only; a replayed tick already reported.

A parented body simulates in world space (worldPoseOf) and is mapped back relative to its parent. The parent's pose is taken once at gather, so a parent moving mid-tick is not followed, and a scaled parent is not handled (a ColliderPart is unscaled).

Member Function Documentation

◆ fixedUpdate()

void Vkm::Engine::PhysicsSystem::fixedUpdate ( FrameContext & ctx)
overridevirtual

Execute this system at the fixed simulation rate.

Called 0+ times per frame; the step is ctx.clock.getFixedStep().

Runs before any producer stage, so ctx.visibility and ctx.ui are null here. ctx.poses is set by SkeletalAnimationSystem's own fixedUpdate, so a later Simulation system reads this tick's pose.

Parameters
ctxThis frame's services; see above for which products are set.

Reimplemented from Vkm::Engine::System.

◆ isReplayed()

bool Vkm::Engine::PhysicsSystem::isReplayed ( ) const
inlineoverridevirtual

Re-run during a replay: it moves the world from state and command, deterministically.

Returns
Always true.

Reimplemented from Vkm::Engine::System.


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