Plasma Engine  2.0
Loading...
Searching...
No Matches
Declarations.h
1#pragma once
2
3#include <Foundation/Communication/Message.h>
4#include <Foundation/Math/Vec3.h>
5#include <Foundation/Reflection/Reflection.h>
6#include <Foundation/Types/Enum.h>
7#include <JoltPlugin/JoltPluginDLL.h>
8
10
12{
13 using StorageType = plUInt32;
14
15 enum Enum
16 {
17 Variable,
18 Fixed,
19 SemiFixed,
20
21 Default = SemiFixed
22 };
23};
24
25PL_DECLARE_REFLECTABLE_TYPE(PL_JOLTPLUGIN_DLL, plJoltSteppingMode);
26
28
38{
39 using StorageType = plUInt32;
40
41 enum Enum
42 {
43 None = 0,
44 // SendReportMsg = PL_BIT(0),
45 ImpactReactions = PL_BIT(1),
46 SlideReactions = PL_BIT(2),
47 RollXReactions = PL_BIT(3),
48 RollYReactions = PL_BIT(4),
49 RollZReactions = PL_BIT(5),
50
51 AllRollReactions = RollXReactions | RollYReactions | RollZReactions,
52 SlideAndRollReactions = AllRollReactions | SlideReactions,
53 AllReactions = ImpactReactions | AllRollReactions | SlideReactions,
54
55 Default = None
56 };
57
58 struct Bits
59 {
60 StorageType SendReportMsg : 1;
61 StorageType ImpactReactions : 1;
62 StorageType SlideReactions : 1;
63 StorageType RollXReactions : 1;
64 StorageType RollYReactions : 1;
65 StorageType RollZReactions : 1;
66 };
67};
68
69PL_DECLARE_FLAGS_OPERATORS(plOnJoltContact);
70PL_DECLARE_REFLECTABLE_TYPE(PL_JOLTPLUGIN_DLL, plOnJoltContact);
71
73
75{
76 plVec3 m_vObjectGravity = plVec3(0, 0, -9.81f);
77 plVec3 m_vCharacterGravity = plVec3(0, 0, -12.0f);
78
79 plEnum<plJoltSteppingMode> m_SteppingMode = plJoltSteppingMode::Fixed;
80 float m_fFixedFrameRate = 60.0f;
81 plUInt32 m_uiMaxSubSteps = 4;
82
83 plUInt32 m_uiMaxBodies = 1000 * 10;
84};
85
87
89struct PL_JOLTPLUGIN_DLL plJoltMsgDisconnectConstraints : public plMessage
90{
91 PL_DECLARE_MESSAGE_TYPE(plJoltMsgDisconnectConstraints, plMessage);
92
94 plJoltActorComponent* m_pActor = nullptr;
95
97 plUInt32 m_uiJoltBodyID = plInvalidIndex;
98};
Base class for all Jolt actors.
Definition JoltActorComponent.h:23
Base class for all message types. Each message type has it's own id which is used to dispatch message...
Definition Message.h:22
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
This message can be sent to a constraint component to break the constraint.
Definition Declarations.h:90
Definition Declarations.h:75
Definition Declarations.h:12
Definition Declarations.h:59
Flags for what should happen when two physical bodies touch.
Definition Declarations.h:38
Enum
Definition Declarations.h:42
@ RollZReactions
Spawn prefabs for rolling (one object rotates around its Z axis while touching another).
Definition Declarations.h:49
@ RollXReactions
Spawn prefabs for rolling (one object rotates around its X axis while touching another).
Definition Declarations.h:47
@ ImpactReactions
Spawn prefabs for impacts (two objects hit each other with enough force).
Definition Declarations.h:45
@ RollYReactions
Spawn prefabs for rolling (one object rotates around its Y axis while touching another).
Definition Declarations.h:48
@ SlideReactions
Spawn prefabs for sliding (one object slides along the surface of another).
Definition Declarations.h:46