Skip to main content

MotionIntegrationSystem Class Template

Updates local position by applying local velocity each frame. More...

Declaration​

template <typename TMemberHandle> class helios::physics::motion::systems::MotionIntegrationSystem<TMemberHandle> { ... }

Public Member Typedefs Index​

template <typename TMemberHandle>
usingEngineRoleTag = TypedSystemRole

Public Member Functions Index​

template <typename TMemberHandle>
voidupdate (UpdateContext &updateContext)

Applies Euler integration to all active entities with position and velocity. More...

Description​

Updates local position by applying local velocity each frame.

Template Parameters
TMemberHandle

ECS handle type.

Definition at line 35 of file MotionIntegrationSystem.ixx.

Public Member Typedefs​

EngineRoleTag​

template <typename TMemberHandle>
using helios::physics::motion::systems::MotionIntegrationSystem< TMemberHandle >::EngineRoleTag = TypedSystemRole

Definition at line 40 of file MotionIntegrationSystem.ixx.

40 using EngineRoleTag = TypedSystemRole;

Public Member Functions​

update()​

template <typename TMemberHandle>
void helios::physics::motion::systems::MotionIntegrationSystem< TMemberHandle >::update (UpdateContext & updateContext)
inline

Applies Euler integration to all active entities with position and velocity.

Parameters
updateContext

Frame update context containing view access and delta time.

Definition at line 48 of file MotionIntegrationSystem.ixx.

48 void update(UpdateContext& updateContext) {
49
50 for (auto[
51 entity,
52 localVelocity,
53 localPosition
54 ]: updateContext.view<
55 TMemberHandle,
57 Position3DComponent<TMemberHandle, Local>
58 >().withActive()
59 ) {
60
61 entity.setTrackedValue(
62 localPosition,
63 localPosition->value() + localVelocity->value() * updateContext.deltaTime()
64 );
65
66 }
67
68 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.