Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Component::ConstraintInternal Struct Reference

Internal component storing Jolt Physics constraint data. More...

#include <ConstraintInternal.hpp>

Public Member Functions

 ConstraintInternal ()=default
 Default constructor (invalid constraint).
 ConstraintInternal (JPH::Constraint *c, ConstraintType t)
 Construct with constraint pointer and type.
 ConstraintInternal (JPH::Constraint *c, ConstraintType t, float force, float torque)
 Construct with constraint pointer, type, and breaking thresholds.
bool IsValid () const
 Check if this component has a valid constraint.
bool IsBreakable () const
 Check if this constraint is breakable.

Public Attributes

JPH::Constraint * constraint = nullptr
 Pointer to the Jolt constraint object.
ConstraintType type = ConstraintType::Fixed
 Type of the constraint for runtime identification.
bool broken = false
 Whether this constraint has been broken (exceeded force/torque thresholds).
float breakForce = 0.0f
 Settings used to create this constraint (for force monitoring).
float breakTorque = 0.0f

Detailed Description

Internal component storing Jolt Physics constraint data.

This component is managed automatically by the ConstraintSystem and should never be added/removed manually by users.

Warning
Internal use only! Do not use directly.

Constructor & Destructor Documentation

◆ ConstraintInternal() [1/3]

Physics::Component::ConstraintInternal::ConstraintInternal ( )
default

Default constructor (invalid constraint).

◆ ConstraintInternal() [2/3]

Physics::Component::ConstraintInternal::ConstraintInternal ( JPH::Constraint * c,
ConstraintType t )
inline

Construct with constraint pointer and type.

Parameters
cPointer to the Jolt constraint
tType of the constraint

◆ ConstraintInternal() [3/3]

Physics::Component::ConstraintInternal::ConstraintInternal ( JPH::Constraint * c,
ConstraintType t,
float force,
float torque )
inline

Construct with constraint pointer, type, and breaking thresholds.

Parameters
cPointer to the Jolt constraint
tType of the constraint
forceBreaking force threshold
torqueBreaking torque threshold

Member Function Documentation

◆ IsBreakable()

bool Physics::Component::ConstraintInternal::IsBreakable ( ) const
inlinenodiscard

Check if this constraint is breakable.

Returns
true if either breakForce or breakTorque is greater than 0

◆ IsValid()

bool Physics::Component::ConstraintInternal::IsValid ( ) const
inlinenodiscard

Check if this component has a valid constraint.

Returns
true if the constraint pointer is valid

Member Data Documentation

◆ breakForce

float Physics::Component::ConstraintInternal::breakForce = 0.0f

Settings used to create this constraint (for force monitoring).

◆ breakTorque

float Physics::Component::ConstraintInternal::breakTorque = 0.0f

◆ broken

bool Physics::Component::ConstraintInternal::broken = false

Whether this constraint has been broken (exceeded force/torque thresholds).

◆ constraint

JPH::Constraint* Physics::Component::ConstraintInternal::constraint = nullptr

Pointer to the Jolt constraint object.

◆ type

ConstraintType Physics::Component::ConstraintInternal::type = ConstraintType::Fixed

Type of the constraint for runtime identification.


The documentation for this struct was generated from the following file: