CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Motion.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Forward.hpp"
11
13
15
18
19namespace CeresEngine {
20
21 struct CE_SCRIPT_EXPORT() Motion final : public Component<Motion> {
23 struct Accessor;
24
27 Vector3 linearVelocity = Vector3(0.0);
28
31 Vector3 angularVelocity = Vector3(0.0);
32
33 public: // Reflection
36 template<typename Processor> static constexpr void reflect(Processor&& RTTI) {
37 CE_REFL_DATA(linearVelocity);
38 CE_REFL_DATA(angularVelocity);
39 }
40 };
41
42 struct CE_SCRIPT_EXPORT() Motion::Accessor : public Component<Motion>::Accessor {
43 using Component<Motion>::Accessor::Accessor;
44
45 public:
47 [[nodiscard]] CE_SCRIPT_EXPORT()
48 Vector3 getLinearVelocity() const;
49
53 void setLinearVelocity(Vector3 linearVelocity);
54
56 [[nodiscard]] CE_SCRIPT_EXPORT()
57 Vector3 getAngularVelocity() const;
58
61 void setAngularVelocity(Vector3 angularVelocity);
62 };
63
64} // namespace CeresEngine
65
68
71
#define CE_EXTERN_COMPONENT(T)
Definition Component.hpp:600
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFLECTABLE_STRUCT
Definition IReflectable.hpp:47
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition Application.hpp:19
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
Definition Motion.hpp:42
Definition Motion.hpp:21