Plasma Engine  2.0
Loading...
Searching...
No Matches
JoltHingeConstraintComponent.h
1#pragma once
2
3#include <JoltPlugin/Constraints/JoltConstraintComponent.h>
4
6
13{
15
17 // plComponent
18
19public:
20 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
21 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
22
24 // plJoltConstraintComponent
25
26protected:
27 virtual void CreateContstraintType(JPH::Body* pBody0, JPH::Body* pBody1) override;
28 virtual void ApplySettings() final override;
29 virtual bool ExceededBreakingPoint() final override;
30
32 // plJoltHingeConstraintComponent
33
34public:
37
39 void SetLimitMode(plJoltConstraintLimitMode::Enum mode); // [ property ]
40 plJoltConstraintLimitMode::Enum GetLimitMode() const { return m_LimitMode; } // [ property ]
41
43 void SetLowerLimitAngle(plAngle f); // [ property ]
44 plAngle GetLowerLimitAngle() const { return m_LowerLimit; } // [ property ]
45
47 void SetUpperLimitAngle(plAngle f); // [ property ]
48 plAngle GetUpperLimitAngle() const { return m_UpperLimit; } // [ property ]
49
51 void SetFriction(float f); // [ property ]
52 float GetFriction() const { return m_fFriction; } // [ property ]
53
55 void SetDriveMode(plJoltConstraintDriveMode::Enum mode); // [ property ]
56 plJoltConstraintDriveMode::Enum GetDriveMode() const { return m_DriveMode; } // [ property ]
57
59 void SetDriveTargetValue(plAngle f); // [ property ]
60 plAngle GetDriveTargetValue() const { return m_DriveTargetValue; } // [ property ]
61
63 void SetDriveStrength(float f); // [ property ]
64 float GetDriveStrength() const { return m_fDriveStrength; } // [ property ]
65
66protected:
68 plAngle m_LowerLimit;
69 plAngle m_UpperLimit;
70 float m_fFriction = 0;
72 plAngle m_DriveTargetValue;
73 float m_fDriveStrength = 0; // 0 means maximum strength
74};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
Definition ComponentManager.h:88
Base class for all Jolt physics joints (constraints).
Definition JoltConstraintComponent.h:73
virtual void DeserializeComponent(plWorldReader &inout_stream) override
Override this to load the current state of the component from the given stream.
Definition JoltConstraintComponent.cpp:214
virtual void SerializeComponent(plWorldWriter &inout_stream) const override
Override this to save the current state of the component to the given stream.
Definition JoltConstraintComponent.cpp:194
Implements a rotational physics constraint.
Definition JoltHingeConstraintComponent.h:13
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Enum
Definition JoltConstraintComponent.h:41
Enum
Definition JoltConstraintComponent.h:24