Skip to main content

MotionIntegrationSystem.ixx File

Integrates local position from local velocity using frame delta time. More...

Included Headers

#include <helios.engine.spatial.components> #include <helios.engine.core.types.ComponentTypeTags> #include <helios.engine.runtime.world.UpdateContext> #include <helios.engine.runtime.world.tags.SystemRole> #include <helios.physics.motion.components> #include <helios.ecs.components.Active>

Namespaces Index

namespacehelios
namespacephysics
namespacemotion
namespacesystems
namespacecomponents
namespacetypes
namespacecomponents
namespaceworld
namespacetags

Classes Index

classMotionIntegrationSystem<TMemberHandle>

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

Description

Integrates local position from local velocity using frame delta time.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7export module helios.physics.motion.systems:MotionIntegrationSystem;
8
9import helios.ecs.components.Active;
10
11import helios.physics.motion.components;
12
13import helios.engine.runtime.world.tags.SystemRole;
14
15import helios.engine.runtime.world.UpdateContext;
16
17import helios.engine.core.types.ComponentTypeTags;
18
19import helios.engine.spatial.components;
20
21using namespace helios::ecs::components;
22using namespace helios::engine::core::types;
24using namespace helios::engine::spatial::components;
25using namespace helios::engine::runtime::world;
26using namespace helios::engine::runtime::world::tags;
28
34 template<typename TMemberHandle>
36
37 public:
38
39
40 using EngineRoleTag = TypedSystemRole;
41
42
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 }
69
70
71 };
72
73
74}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.