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

Abstract base class for per-frame systems. More...

#include <system.h>

Inheritance diagram for Vkm::Engine::System:
Vkm::Engine::AnimationSystem Vkm::Engine::AsyncLoaderSystem Vkm::Engine::AudioSystem Vkm::Engine::BehaviorSystem Vkm::Engine::BoneSocketSystem Vkm::Engine::CharacterControllerSystem Vkm::Engine::HierarchySystem Vkm::Engine::ParticleSystem Vkm::Engine::PhysicsSystem Vkm::Engine::RagdollSystem Vkm::Engine::RenderSystem Vkm::Engine::SkeletalAnimationSystem Vkm::Engine::SkySystem Vkm::Engine::SplashSystem Vkm::Engine::UISystem Vkm::Engine::VisibilitySystem

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.

Detailed Description

Abstract base class for per-frame systems.

Scheduled per SystemStage; see SystemStage for ordering.

Member Function Documentation

◆ isReplayed()

virtual bool Vkm::Engine::System::isReplayed ( ) const
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.

Returns
True to take part in the replay pass.

Reimplemented in Vkm::Engine::BehaviorSystem, Vkm::Engine::CharacterControllerSystem, and Vkm::Engine::PhysicsSystem.

◆ init()

virtual void Vkm::Engine::System::init ( FrameContext & ctx)
inlinevirtual

Called once after all systems are registered, before the first update.

Parameters
ctxThe first frame's context; its products are all null.

Reimplemented in Vkm::Engine::AudioSystem, Vkm::Engine::BehaviorSystem, and Vkm::Engine::RagdollSystem.

◆ update()

virtual void Vkm::Engine::System::update ( FrameContext & ctx)
inlinevirtual

◆ fixedUpdate()

virtual void Vkm::Engine::System::fixedUpdate ( FrameContext & ctx)
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.

Parameters
ctxThis 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.


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