Class SliderConstraint
Hierarchy (View Summary)
- PhysicsConstraint
- SliderConstraint
Properties
_ plugin Data
_pluginData: any = undefined
V2 Physics plugin private data for a physics material
Accessors
is Collisions Enabled
-
get isCollisionsEnabled(): boolean
Gets whether collisions are enabled for this physics object.
Returns boolean
trueif collisions are enabled,falseotherwise. -
set isCollisionsEnabled(isEnabled: boolean): void
Enables or disables collisions for the physics engine.
Parameters
- isEnabled: boolean
A boolean value indicating whether collisions should be enabled or disabled.
Returns void
- isEnabled: boolean
is Enabled
-
get isEnabled(): boolean
Returns boolean
true if constraint is enabled
-
set isEnabled(isEnabled: boolean): void
Enable/disable the constraint
Parameters
- isEnabled: boolean
value for the constraint
Returns void
- isEnabled: boolean
options
-
Retrieves the options of the physics constraint.
Returns PhysicsConstraintParameters
The physics constraint parameters.
type
Methods
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 Constraint
-
Gets all bodies that are using this constraint
Returns ConstrainedBodyPair[]
Creates a SliderConstraint, which is a type of PhysicsConstraint.
This code is useful for creating a SliderConstraint, which is a type of PhysicsConstraint. It allows the user to specify the two pivots and two axes of the constraint in world space, as well as the scene the constraint belongs to. This is useful for creating a constraint between two rigid bodies that allows them to move along a certain axis.
Param: pivotA
The first pivot of the constraint, in world space.
Param: pivotB
The second pivot of the constraint, in world space.
Param: axisA
The first axis of the constraint, in world space.
Param: axisB
The second axis of the constraint, in world space.
Param: scene
The scene the constraint belongs to.
Returns
The created SliderConstraint.