Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
Velocity.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
14#pragma once
15
16// =============================================================================
17// Includes
18// =============================================================================
19
20#include "../../core/Types.hpp"
22#include "../../math/Math.hpp"
23
24namespace esengine::ecs {
25
26// =============================================================================
27// Velocity Component
28// =============================================================================
29
41struct Velocity {
43 ES_PROPERTY(replicated)
44 glm::vec3 linear{0.0f};
45
47 ES_PROPERTY(replicated)
48 glm::vec3 angular{0.0f};
49
51 Velocity() = default;
52
57 explicit Velocity(const glm::vec3& lin) : linear(lin) {}
58
64 Velocity(const glm::vec3& lin, const glm::vec3& ang) : linear(lin), angular(ang) {}
65};
66
67} // namespace esengine::ecs
Math utilities and GLM configuration for ESEngine.
Reflection and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
Velocity(const glm::vec3 &lin)
Constructs with linear velocity only.
Definition Velocity.hpp:57
Velocity(const glm::vec3 &lin, const glm::vec3 &ang)
Constructs with both linear and angular velocity.
Definition Velocity.hpp:64
Velocity()=default
Default constructor (zero velocity).
glm::vec3 linear
Linear velocity (units per second).
Definition Velocity.hpp:44
glm::vec3 angular
Angular velocity (radians per second).
Definition Velocity.hpp:48