![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Abstract base class for per-frame systems. More...
#include <system.h>
Public Member Functions | |
| virtual bool | isReplayed () const |
| Whether this system may be re-run over a tick that already happened. | |
| 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. | |
| virtual void | fixedUpdate (FrameContext &ctx) |
| Execute this system at the fixed simulation rate. | |
Abstract base class for per-frame systems.
Scheduled per SystemStage; see SystemStage for ordering.
|
inlinevirtual |
Whether this system may be re-run over a tick that already happened.
When a client's prediction disagrees with the server, every tick since is re-run. A replayed system must be a pure function of world and command, where running twice equals running once.
A system with effects (events, sounds, animation steps) answers false, or true and leaves the effects to what it runs: BehaviorSystem replays, and a behavior asks isReplaying() before it presents.
Reimplemented in Vkm::Engine::BehaviorSystem, Vkm::Engine::CharacterControllerSystem, and Vkm::Engine::PhysicsSystem.
|
inlinevirtual |
Called once after all systems are registered, before the first update.
| ctx | The first frame's context; its products are all null. |
Reimplemented in Vkm::Engine::AudioSystem, Vkm::Engine::BehaviorSystem, and Vkm::Engine::RagdollSystem.
|
inlinevirtual |
Execute this system for the current frame.
| ctx | This frame's services and the products published so far. |
Reimplemented in Vkm::Engine::AsyncLoaderSystem, Vkm::Engine::AudioSystem, Vkm::Engine::BehaviorSystem, Vkm::Engine::BoneSocketSystem, Vkm::Engine::HierarchySystem, Vkm::Engine::ParticleSystem, Vkm::Engine::RenderSystem, Vkm::Engine::SkeletalAnimationSystem, Vkm::Engine::SkySystem, Vkm::Engine::SplashSystem, Vkm::Engine::UISystem, and Vkm::Engine::VisibilitySystem.
|
inlinevirtual |
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.
| ctx | This frame's services; see above for which products are set. |
Reimplemented in Vkm::Engine::AnimationSystem, Vkm::Engine::BehaviorSystem, Vkm::Engine::CharacterControllerSystem, Vkm::Engine::PhysicsSystem, Vkm::Engine::RagdollSystem, and Vkm::Engine::SkeletalAnimationSystem.