Class HingeConstraint
Hierarchy
- PhysicsConstraint
- HingeConstraint
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Properties
_plugin DataSearch playground for _pluginData
V2 Physics plugin private data for a physics material
Accessors
is Collisions Enabled
Gets whether collisions are enabled for this physics object.
Returns boolean
true
if collisions are enabled,false
otherwise.Enables or disables collisions for the physics engine.
Parameters
isEnabled: boolean
A boolean value indicating whether collisions should be enabled or disabled.
Returns void
is Enabled
Enable/disable the constraint
Returns boolean
true if constraint is enabled
Enable/disable the constraint
Parameters
isEnabled: boolean
value for the constraint
Returns void
options
Retrieves the options of the physics constraint.
Returns PhysicsConstraintParameters
The physics constraint parameters.
type
Gets the type of the constraint.
Returns PhysicsConstraintType
The type of the constraint.
Methods
disposeSearch playground for dispose
Disposes the constraint from the physics engine.
This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
Returns void
get Bodies Using ConstraintSearch playground for getBodiesUsingConstraint
Gets all bodies that are using this constraint
Returns ConstrainedBodyPair[]
Creates a HingeConstraint, which is a type of PhysicsConstraint.
The first pivot point, in world space.
The second pivot point, in world space.
The scene the constraint is used in.
The new HingeConstraint.
This code is useful for creating a HingeConstraint, which is a type of PhysicsConstraint. This constraint is used to simulate a hinge joint between two rigid bodies, allowing them to rotate around a single axis.