#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
float Real
Definition Real.h:27
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(class_name)
Definition SerializableObject.h:100
Array< Wheel * > Wheels
Definition Wheel.h:145
Definition AxisConstraintPart.h:42
float GetTotalLambda() const
Return lagrange multiplier.
Definition AxisConstraintPart.h:378
bool IsActive() const
Check if constraint is active.
Definition AxisConstraintPart.h:196
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
bool IsInvalid() const
Check if the ID is valid.
Definition BodyID.h:64
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Definition Reference.h:154
Definition Reference.h:35
Definition SerializableObject.h:147
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition SubShapeID.h:23
Definition VehicleConstraint.h:67
Base class for runtime data for a wheel, each VehicleController can implement a derived class of this...
Definition Wheel.h:45
RefConst< WheelSettings > mSettings
Configuration settings for this wheel.
Definition Wheel.h:122
float GetRotationAngle() const
Get the current rotation angle of the wheel in radians [0, 2 pi].
Definition Wheel.h:63
bool SolveLateralConstraintPart(const VehicleConstraint &inConstraint, float inMinImpulse, float inMaxImpulse)
Internal function that should only be called by the controller. Used to apply impulses in the sideway...
Definition Wheel.cpp:83
float GetSteerAngle() const
Get the current steer angle of the wheel in radians [-pi, pi], positive is to the left.
Definition Wheel.h:69
JPH_OVERRIDE_NEW_DELETE Wheel(const WheelSettings &inSettings)
Constructor / destructor.
Definition Wheel.cpp:61
Vec3 mContactNormal
Normal of the contact point between wheel and ground.
Definition Wheel.h:129
float mAntiRollBarImpulse
Amount of impulse applied to the suspension from the anti-rollbars.
Definition Wheel.h:133
Vec3 GetContactLateral() const
Returns lateral direction (sideways direction) in world space (note by the time you call this the veh...
Definition Wheel.h:96
float mAngularVelocity
Rotation speed of wheel, positive when the wheels cause the vehicle to move forwards (rad/s)
Definition Wheel.h:136
void SetAngularVelocity(float inVel)
Update the angular velocity (rad/s)
Definition Wheel.h:60
float GetLateralLambda() const
Get total impulse (N s) applied along the sideways direction of the wheel.
Definition Wheel.h:111
AxisConstraintPart mLateralPart
Controls movement sideways (slip)
Definition Wheel.h:142
Vec3 mContactLongitudinal
Vector perpendicular to normal in the forward direction.
Definition Wheel.h:130
float mSuspensionLength
Current length of the suspension.
Definition Wheel.h:126
SubShapeID GetContactSubShapeID() const
Returns the sub shape ID where we're contacting the body.
Definition Wheel.h:81
Vec3 GetContactLongitudinal() const
Returns longitudinal direction (direction along the wheel relative to floor) in world space (note by ...
Definition Wheel.h:93
BodyID mContactBodyID
ID of body for ground.
Definition Wheel.h:123
AxisConstraintPart mSuspensionMaxUpPart
Adds a hard limit when reaching the minimal suspension length.
Definition Wheel.h:140
bool HasHitHardPoint() const
Check if the suspension hit its upper limit.
Definition Wheel.h:102
Vec3 mContactPointVelocity
Velocity of the contact point (m / s, not relative to the wheel but in world space)
Definition Wheel.h:128
void SetSteerAngle(float inAngle)
Set the current steer angle of the wheel in radians [-pi, pi].
Definition Wheel.h:72
Vec3 GetContactPointVelocity() const
Velocity of the contact point (m / s, not relative to the wheel but in world space)
Definition Wheel.h:87
AxisConstraintPart mSuspensionPart
Controls movement up/down along the contact normal.
Definition Wheel.h:139
Real mAxlePlaneConstant
Constant for the contact plane of the axle, defined as ContactNormal . (WorldSpaceSuspensionPoint + S...
Definition Wheel.h:132
void SetRotationAngle(float inAngle)
Set the current rotation angle of the wheel in radians [0, 2 pi].
Definition Wheel.h:66
AxisConstraintPart mLongitudinalPart
Controls movement forward/backward.
Definition Wheel.h:141
Vec3 GetContactNormal() const
Returns the current contact mormal in world space (note by the time you call this the vehicle has mov...
Definition Wheel.h:90
const WheelSettings * GetSettings() const
Get settings for the wheel.
Definition Wheel.h:54
RVec3 mContactPosition
Position of the contact point between wheel and ground.
Definition Wheel.h:127
bool SolveLongitudinalConstraintPart(const VehicleConstraint &inConstraint, float inMinImpulse, float inMaxImpulse)
Internal function that should only be called by the controller. Used to apply impulses in the forward...
Definition Wheel.cpp:78
float GetLongitudinalLambda() const
Get total impulse (N s) applied along the forward direction of the wheel.
Definition Wheel.h:108
Body * mContactBody
Body for ground.
Definition Wheel.h:125
BodyID GetContactBodyID() const
Returns the body ID of the body that this wheel is touching.
Definition Wheel.h:78
float GetSuspensionLength() const
Get the length of the suspension for a wheel (m) relative to the suspension attachment point (hard po...
Definition Wheel.h:99
float mAngle
Current rotation of the wheel (rad, [0, 2 pi])
Definition Wheel.h:137
float GetAngularVelocity() const
Get the angular velocity (rad/s) for this wheel, note that positive means the wheel is rotating such ...
Definition Wheel.h:57
bool HasContact() const
Returns true if the wheel is touching an object.
Definition Wheel.h:75
Vec3 mContactLateral
Vector perpendicular to normal and longitudinal direction in the right direction.
Definition Wheel.h:131
float mSteerAngle
Rotation around the suspension direction, positive is to the left.
Definition Wheel.h:135
float GetSuspensionLambda() const
Get the total impulse (N s) that was applied by the suspension.
Definition Wheel.h:105
SubShapeID mContactSubShapeID
Sub shape ID for ground.
Definition Wheel.h:124
RVec3 GetContactPosition() const
Returns the current contact position in world space (note by the time you call this the vehicle has m...
Definition Wheel.h:84
Base class for wheel settings, each VehicleController can implement a derived class of this.
Definition Wheel.h:19
float mSuspensionPreloadLength
The natural length (m) of the suspension spring is defined as mSuspensionMaxLength + mSuspensionPrelo...
Definition Wheel.h:36
Vec3 mSuspensionDirection
Direction of the suspension in local space of the body, should point down.
Definition Wheel.h:30
float mSuspensionMaxLength
How long the suspension is in max droop position relative to the attachment point (m)
Definition Wheel.h:35
float mWidth
Width of the wheel (m)
Definition Wheel.h:40
Vec3 mPosition
Attachment point of wheel suspension in local space of the body.
Definition Wheel.h:29
virtual void SaveBinaryState(StreamOut &inStream) const
Saves the contents in binary form to inStream.
Definition Wheel.cpp:29
float mSuspensionDamping
Damping factor of the suspension spring (0 = no damping, 1 = critical damping)
Definition Wheel.h:38
virtual void RestoreBinaryState(StreamIn &inStream)
Restores the contents in binary form to inStream.
Definition Wheel.cpp:45
Vec3 mWheelUp
Up direction when the wheel is in the neutral steering position (usually VehicleConstraintSettings::m...
Definition Wheel.h:32
Vec3 mSteeringAxis
Direction of the steering axis in local space of the body, should point up (e.g. for a bike would be ...
Definition Wheel.h:31
float mSuspensionFrequency
Natural frequency of the suspension spring (Hz)
Definition Wheel.h:37
Vec3 mWheelForward
Forward direction when the wheel is in the neutral steering position (usually VehicleConstraintSettin...
Definition Wheel.h:33
float mRadius
Radius of the wheel (m)
Definition Wheel.h:39
float mSuspensionMinLength
How long the suspension is in max raised position relative to the attachment point (m)
Definition Wheel.h:34