Class LockConstraint
Hierarchy
- PhysicsConstraint
- LockConstraint
Index
Constructors
Properties
Methods
- dispose
- get
Axis Friction - get
Axis Max Limit - get
Axis Min Limit - get
Axis Mode - get
Axis Motor Max Force - get
Axis Motor Target - get
Axis Motor Type - get
Collisions Enabled - get
Enabled - get
Options - get
Type - set
Axis Friction - set
Axis Max Limit - set
Axis Min Limit - set
Axis Mode - set
Axis Motor Max Force - set
Axis Motor Target - set
Axis Motor Type - set
Collisions Enabled - set
Enabled
Constructors
constructor
Properties
_plugin DataSearch playground for _pluginData
V2 Physics plugin private data for a physics material
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 Axis FrictionSearch playground for getAxisFriction
Gets the friction of the given axis of the physics engine.
Parameters
axis: ConstraintAxis
The axis of the physics engine.
Returns number
The friction of the given axis.
get Axis Max LimitSearch playground for getAxisMaxLimit
Gets the maximum limit of the given axis of the physics engine.
Parameters
axis: ConstraintAxis
The axis of the physics engine.
Returns number
The maximum limit of the given axis.
get Axis Min LimitSearch playground for getAxisMinLimit
Gets the minimum limit of the given axis of the physics engine.
Parameters
axis: ConstraintAxis
The axis of the physics engine.
Returns number
The minimum limit of the given axis.
get Axis ModeSearch playground for getAxisMode
Gets the limit mode of the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
Returns ConstraintAxisLimitMode
The limit mode of the given axis.
get Axis Motor Max ForceSearch playground for getAxisMotorMaxForce
Gets the maximum force of the motor of the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
Returns number
The maximum force of the motor.
get Axis Motor TargetSearch playground for getAxisMotorTarget
Gets the target velocity of the motor associated to the given constraint axis.
Parameters
axis: ConstraintAxis
The constraint axis associated to the motor.
Returns number
The target velocity of the motor.
get Axis Motor TypeSearch playground for getAxisMotorType
Gets the motor type of the specified axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
Returns ConstraintMotorType
The motor type of the specified axis.
get Collisions EnabledSearch playground for getCollisionsEnabled
Gets whether collisions are enabled for this physics object.
Returns boolean
true
if collisions are enabled,false
otherwise.
get EnabledSearch playground for getEnabled
Returns boolean
true if constraint is enabled
get OptionsSearch playground for getOptions
Retrieves the options of the physics constraint.
Returns PhysicsConstraintParameters
The physics constraint parameters.
get TypeSearch playground for getType
Gets the type of the constraint.
Returns ConstraintType
The type of the constraint.
set Axis FrictionSearch playground for setAxisFriction
Sets the friction of the given axis of the physics engine.
Parameters
axis: ConstraintAxis
The axis of the physics engine to set the friction for.
friction: number
The friction to set for the given axis.
Returns void
set Axis Max LimitSearch playground for setAxisMaxLimit
Sets the maximum limit of the given axis for the physics engine.
Parameters
axis: ConstraintAxis
The axis to set the limit for.
limit: number
The maximum limit of the axis.
This method is useful for setting the maximum limit of the given axis for the physics engine, which can be used to control the movement of the physics object. This helps to ensure that the physics object does not move beyond the given limit.
Returns void
set Axis Min LimitSearch playground for setAxisMinLimit
Sets the minimum limit of a given axis of a constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
minLimit: number
The minimum limit of the axis.
Returns void
set Axis ModeSearch playground for setAxisMode
Sets the limit mode for the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis to set the limit mode for.
limitMode: ConstraintAxisLimitMode
The limit mode to set.
This method is useful for setting the limit mode for a given axis of the constraint. This is important for controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode, the engine can be configured to either stop the motion of the objects, or to allow them to continue moving beyond the constraint.
Returns void
set Axis Motor Max ForceSearch playground for setAxisMotorMaxForce
Sets the maximum force of the motor of the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
maxForce: number
The maximum force of the motor.
Returns void
set Axis Motor TargetSearch playground for setAxisMotorTarget
Sets the target velocity of the motor associated with the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
target: number
The target velocity of the motor.
This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.
Returns void
set Axis Motor TypeSearch playground for setAxisMotorType
Sets the motor type of the given axis of the constraint.
Parameters
axis: ConstraintAxis
The axis of the constraint.
motorType: ConstraintMotorType
The type of motor to use.
Returns void
void
set Collisions EnabledSearch playground for setCollisionsEnabled
Enables or disables collisions for the physics engine.
Parameters
isEnabled: boolean
A boolean value indicating whether collisions should be enabled or disabled.
Returns void
set EnabledSearch playground for setEnabled
Enable/disable the constraint
Parameters
isEnabled: boolean
value for the constraint
Returns void
Creates a LockConstraint, which is a type of PhysicsConstraint.
The first pivot of the constraint in local space.
The second pivot of the constraint in local space.
The first axis of the constraint in local space.
The second axis of the constraint in local space.
The scene the constraint belongs to.
The created LockConstraint.
This code is useful for creating a LockConstraint, which is a type of PhysicsConstraint. It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a LockConstraint.