Class PhysicsConstraint
Hierarchy
- PhysicsConstraint
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
Child Body - get
Collisions Enabled - get
Enabled - get
Parent Body - set
Anchor In Child - set
Anchor In Parent - 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
Child Body - set
Collisions Enabled - set
Enabled - set
Parent Body
Constructors
constructor
Constructs a new constraint for the physics constraint.
Parameters
type: ConstraintType
The type of constraint to create.
options: PhysicsConstraintParameters
The options for the constraint.
scene: Scene
The scene the constraint belongs to.
This code is useful for creating a new constraint for the physics engine. It checks if the scene has a physics engine, and if the plugin version is correct. If all checks pass, it initializes the constraint with the given type and options.
Returns PhysicsConstraint
Properties
_plugin DataSearch playground for _pluginData
V2 Physics plugin private data for a physics material
Methods
disposeSearch playground for dispose
Returns void
get Axis FrictionSearch playground for getAxisFriction
Parameters
axis: ConstraintAxis
Returns number
get Axis Max LimitSearch playground for getAxisMaxLimit
Parameters
axis: ConstraintAxis
Returns number
get Axis Min LimitSearch playground for getAxisMinLimit
Parameters
axis: ConstraintAxis
Returns number
get Axis ModeSearch playground for getAxisMode
Parameters
axis: ConstraintAxis
Returns ConstraintAxisLimitMode
get Axis Motor Max ForceSearch playground for getAxisMotorMaxForce
Parameters
axis: ConstraintAxis
Returns number
get Axis Motor TargetSearch playground for getAxisMotorTarget
Parameters
axis: ConstraintAxis
Returns number
get Axis Motor TypeSearch playground for getAxisMotorType
Parameters
axis: ConstraintAxis
Returns ConstraintMotorType
get Child BodySearch playground for getChildBody
Retrieves the child body of the current physics constraint.
Returns undefined | PhysicsBody
The child body of the current physics constraint, or
undefined
if no child body is present.
get Collisions EnabledSearch playground for getCollisionsEnabled
Returns boolean
get EnabledSearch playground for getEnabled
Returns boolean
get Parent BodySearch playground for getParentBody
Retrieves the parent body of the current physics constraint.
Returns undefined | PhysicsBody
The parent body of the current physics constraint, or
undefined
if the current constraint does not have a parent body.
set Anchor In ChildSearch playground for setAnchorInChild
set Anchor In ParentSearch playground for setAnchorInParent
set Axis FrictionSearch playground for setAxisFriction
Parameters
axis: ConstraintAxis
friction: number
Returns void
set Axis Max LimitSearch playground for setAxisMaxLimit
Parameters
axis: ConstraintAxis
limit: number
Returns void
set Axis Min LimitSearch playground for setAxisMinLimit
Parameters
axis: ConstraintAxis
minLimit: number
Returns void
set Axis ModeSearch playground for setAxisMode
Parameters
axis: ConstraintAxis
limitMode: ConstraintAxisLimitMode
Returns void
set Axis Motor Max ForceSearch playground for setAxisMotorMaxForce
Parameters
axis: ConstraintAxis
maxForce: number
Returns void
set Axis Motor TargetSearch playground for setAxisMotorTarget
Parameters
axis: ConstraintAxis
target: number
Returns void
set Axis Motor TypeSearch playground for setAxisMotorType
Parameters
axis: ConstraintAxis
motorType: ConstraintMotorType
Returns void
set Child BodySearch playground for setChildBody
Sets the child body of the current body.
Parameters
body: PhysicsBody
The child body to set.
This method is useful for setting the child body of the current body in a physics engine. This allows for the creation of complex structures of bodies that interact with each other in a realistic way.
Returns void
set Collisions EnabledSearch playground for setCollisionsEnabled
Parameters
isEnabled: boolean
Returns void
set EnabledSearch playground for setEnabled
Parameters
isEnabled: boolean
Returns void
set Parent BodySearch playground for setParentBody
Sets the parent body of this body.
Parameters
body: PhysicsBody
The parent body to set.
This method is useful for setting the parent body of a physics body in a physics engine. This allows the engine to accurately simulate the motion of the body in relation to its parent body. For example, if the parent body is a planet, the engine can accurately simulate the motion of the body in relation to the planet's gravity.
Returns void
This is a holder class for the physics constraint created by the physics plugin It holds a set of functions to control the underlying constraint
https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine