Class: Generic6DofSpringConstraint
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:9
Generic six-degree-of-freedom constraint with spring behavior.
Extends
ConstraintBase<btGeneric6DofSpringConstraint>
Constructors
Constructor
new Generic6DofSpringConstraint():
Generic6DofSpringConstraint
Returns
Generic6DofSpringConstraint
Inherited from
ConstraintBase<Ammo.btGeneric6DofSpringConstraint>.constructor
Properties
object3D
object3D:
Object3D=null
Defined in: src/components/ComponentBase.ts:29
owner object3D
Inherited from
ConstraintBase.object3D
isDestroyed
isDestroyed:
boolean=false
Defined in: src/components/ComponentBase.ts:77
Inherited from
ConstraintBase.isDestroyed
pivotSelf
pivotSelf:
Vector3
Defined in: packages/physics/constraint/ConstraintBase.ts:19
The pivot point for the self body FrameInA Origin
Inherited from
ConstraintBase.pivotSelf
pivotTarget
pivotTarget:
Vector3
Defined in: packages/physics/constraint/ConstraintBase.ts:24
The pivot point for the target body FrameInB Origin
Inherited from
ConstraintBase.pivotTarget
rotationSelf
rotationSelf:
Quaternion
Defined in: packages/physics/constraint/ConstraintBase.ts:29
The rotation for the self body FrameInA Rotation
Inherited from
ConstraintBase.rotationSelf
rotationTarget
rotationTarget:
Quaternion
Defined in: packages/physics/constraint/ConstraintBase.ts:34
The rotation for the target body FrameInB Rotation
Inherited from
ConstraintBase.rotationTarget
disableCollisionsBetweenLinkedBodies
disableCollisionsBetweenLinkedBodies:
boolean=true
Defined in: packages/physics/constraint/ConstraintBase.ts:36
Inherited from
ConstraintBase.disableCollisionsBetweenLinkedBodies
useLinearFrameReferenceFrame
useLinearFrameReferenceFrame:
boolean=true
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:132
Whether to use the linear reference frame. Default true
Accessors
visibleLayer
Get Signature
get visibleLayer():
number
Defined in: src/components/ComponentBase.ts:46
Composition-layer membership bitmask. The pass / camera / collector filters via
(component.visibleLayer & pass.layerMask & camera.cullingMask) !== 0
Defaults to VisibleLayer.Default (bit 0) so a fresh subclass is visible to passes whose layerMask is VisibleLayer.All (which includes bit 0). Application code can assign project-specific bits (1..31) to organise the scene into composition layers.
Returns
number
Set Signature
set visibleLayer(
value):void
Defined in: src/components/ComponentBase.ts:50
Parameters
value
number
Returns
void
Inherited from
ConstraintBase.visibleLayer
eventDispatcher
Get Signature
get eventDispatcher():
CEventDispatcher
Defined in: src/components/ComponentBase.ts:63
Returns
CEventDispatcher
Set Signature
set eventDispatcher(
value):void
Defined in: src/components/ComponentBase.ts:68
Parameters
value
CEventDispatcher
Returns
void
Inherited from
ConstraintBase.eventDispatcher
isStart
Get Signature
get isStart():
boolean
Defined in: src/components/ComponentBase.ts:79
Returns
boolean
Inherited from
ConstraintBase.isStart
transform
Get Signature
get transform():
Transform
Defined in: src/components/ComponentBase.ts:89
Return the Transform component attached to the Object3D. Null before the component is attached — addComponent assigns object3D only after construction — so constructor-time callers can probe safely via this.transform?..
Returns
Transform
Inherited from
ConstraintBase.transform
enable
Get Signature
get enable():
boolean
Defined in: src/components/ComponentBase.ts:113
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Returns
boolean
Set Signature
set enable(
value):void
Defined in: src/components/ComponentBase.ts:96
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Parameters
value
boolean
Returns
void
Inherited from
ConstraintBase.enable
breakingThreshold
Get Signature
get breakingThreshold():
number
Defined in: packages/physics/constraint/ConstraintBase.ts:41
Breaking impulse threshold. The larger the value, the harder the constraint is to break.
Returns
number
Set Signature
set breakingThreshold(
value):void
Defined in: packages/physics/constraint/ConstraintBase.ts:45
Parameters
value
number
Returns
void
Inherited from
ConstraintBase.breakingThreshold
constraint
Get Signature
get constraint():
T
Defined in: packages/physics/constraint/ConstraintBase.ts:87
Get the constraint instance
Returns
T
Inherited from
ConstraintBase.constraint
targetRigidbody
Get Signature
get targetRigidbody():
Rigidbody
Defined in: packages/physics/constraint/ConstraintBase.ts:119
Target rigid body component
Returns
Set Signature
set targetRigidbody(
value):void
Defined in: packages/physics/constraint/ConstraintBase.ts:123
Parameters
value
Returns
void
Inherited from
ConstraintBase.targetRigidbody
linearLowerLimit
Get Signature
get linearLowerLimit():
Vector3
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:24
default: -1e30, -1e30, -1e30
Returns
Vector3
Set Signature
set linearLowerLimit(
value):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:27
Parameters
value
Vector3
Returns
void
linearUpperLimit
Get Signature
get linearUpperLimit():
Vector3
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:35
default: 1e30, 1e30, 1e30
Returns
Vector3
Set Signature
set linearUpperLimit(
value):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:38
Parameters
value
Vector3
Returns
void
angularLowerLimit
Get Signature
get angularLowerLimit():
Vector3
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:46
default: -Math.PI, -Math.PI, -Math.PI
Returns
Vector3
Set Signature
set angularLowerLimit(
value):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:49
Parameters
value
Vector3
Returns
void
angularUpperLimit
Get Signature
get angularUpperLimit():
Vector3
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:57
default: Math.PI, Math.PI, Math.PI
Returns
Vector3
Set Signature
set angularUpperLimit(
value):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:60
Parameters
value
Vector3
Returns
void
Methods
init()
init(
param?):void
Defined in: src/components/ComponentBase.ts:161
Parameters
param?
any
Returns
void
Inherited from
ConstraintBase.init
stop()
stop():
void
Defined in: src/components/ComponentBase.ts:163
Returns
void
Inherited from
ConstraintBase.stop
onEnable()?
optionalonEnable(view?):any
Defined in: src/components/ComponentBase.ts:164
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onEnable
onDisable()?
optionalonDisable(view?):any
Defined in: src/components/ComponentBase.ts:165
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onDisable
onUpdate()?
optionalonUpdate(view?):any
Defined in: src/components/ComponentBase.ts:166
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onUpdate
onLateUpdate()?
optionalonLateUpdate(view?):any
Defined in: src/components/ComponentBase.ts:167
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onLateUpdate
onBeforeUpdate()?
optionalonBeforeUpdate(view?):any
Defined in: src/components/ComponentBase.ts:168
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onBeforeUpdate
onCompute()?
optionalonCompute(view?,command?):any
Defined in: src/components/ComponentBase.ts:169
Parameters
view?
View3D
command?
GPUCommandEncoder
Returns
any
Inherited from
ConstraintBase.onCompute
onGraphic()?
optionalonGraphic(view?):any
Defined in: src/components/ComponentBase.ts:170
Parameters
view?
View3D
Returns
any
Inherited from
ConstraintBase.onGraphic
onParentChange()?
optionalonParentChange(lastParent?,currentParent?):any
Defined in: src/components/ComponentBase.ts:171
Parameters
lastParent?
Object3D
currentParent?
Object3D
Returns
any
Inherited from
ConstraintBase.onParentChange
onAddChild()?
optionalonAddChild(child):any
Defined in: src/components/ComponentBase.ts:172
Parameters
child
Object3D
Returns
any
Inherited from
ConstraintBase.onAddChild
onRemoveChild()?
optionalonRemoveChild(child):any
Defined in: src/components/ComponentBase.ts:173
Parameters
child
Object3D
Returns
any
Inherited from
ConstraintBase.onRemoveChild
cloneTo()
cloneTo(
obj):void
Defined in: src/components/ComponentBase.ts:180
clone component data to target object3D
Parameters
obj
Object3D
target object3D
Returns
void
Inherited from
ConstraintBase.cloneTo
copyComponent()
copyComponent(
from):this
Defined in: src/components/ComponentBase.ts:182
Parameters
from
this
Returns
this
Inherited from
ConstraintBase.copyComponent
beforeDestroy()
beforeDestroy(
force?):void
Defined in: src/components/ComponentBase.ts:249
before release this component, object refrences are not be set null now.
Parameters
force?
boolean
Returns
void
Inherited from
ConstraintBase.beforeDestroy
start()
start():
Promise<void>
Defined in: packages/physics/constraint/ConstraintBase.ts:50
Returns
Promise<void>
Inherited from
ConstraintBase.start
wait()
wait():
Promise<btGeneric6DofSpringConstraint>
Defined in: packages/physics/constraint/ConstraintBase.ts:97
Asynchronously retrieve the fully initialized constraint instance
Returns
Promise<btGeneric6DofSpringConstraint>
Inherited from
ConstraintBase.wait
resetConstraint()
resetConstraint():
Promise<btGeneric6DofSpringConstraint>
Defined in: packages/physics/constraint/ConstraintBase.ts:105
Reset the constraint: destroy the current constraint instance, recreate it, and return the new constraint instance
Returns
Promise<btGeneric6DofSpringConstraint>
Inherited from
ConstraintBase.resetConstraint
destroy()
destroy(
force?):void
Defined in: packages/physics/constraint/ConstraintBase.ts:127
release this component
Parameters
force?
boolean
Returns
void
Inherited from
ConstraintBase.destroy
enableSpring()
enableSpring(
index,onOff):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:70
Enable or disable the spring on a given axis.
Parameters
index
number
Spring index
onOff
boolean
Whether to enable it
Returns
void
setStiffness()
setStiffness(
index,stiffness):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:83
Set the stiffness of the spring.
Parameters
index
number
Spring index
stiffness
number
Stiffness value
Returns
void
setDamping()
setDamping(
index,damping):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:96
Set the damping of the spring.
Parameters
index
number
Spring index
damping
number
Damping value
Returns
void
setEquilibriumPoint()
setEquilibriumPoint(
index?,val?):void
Defined in: packages/physics/constraint/Generic6DofSpringConstraint.ts:114
Set the equilibrium point of the spring.
Parameters
index?
number
Spring index (optional). If omitted, the equilibrium points of all springs are reset.
val?
number
Equilibrium-point value (optional). If provided, the specified spring's equilibrium point is set to this value.
- With no arguments, resets the equilibrium points of all springs.
- With only
index, sets the equilibrium point of the specified spring (the value is determined internally). - With both
indexandval, sets the equilibrium point of the specified spring toval.
Returns
void

