Class: SliderConstraint
滑动关节约束
Hierarchy
ConstraintBase<btSliderConstraint>↳
SliderConstraint
Constructors
Properties
- pivotSelf
- pivotTarget
- rotationSelf
- rotationTarget
- disableCollisionsBetweenLinkedBodies
- useLinearReferenceFrame
- object3D
- isDestroyed
Accessors
- breakingThreshold
- constraint
- targetRigidbody
- lowerLinLimit
- upperLinLimit
- lowerAngLimit
- upperAngLimit
- poweredLinMotor
- maxLinMotorForce
- targetLinMotorVelocity
- eventDispatcher
- isStart
- transform
- enable
Methods
- start
- wait
- resetConstraint
- destroy
- init
- stop
- onEnable
- onDisable
- onUpdate
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- cloneTo
- copyComponent
- beforeDestroy
Constructors
constructor
• new SliderConstraint(): SliderConstraint
Returns
Inherited from
ConstraintBase<Ammo.btSliderConstraint>.constructor
Properties
pivotSelf
• pivotSelf: Vector3
The pivot point for the self body FrameInA Origin
Inherited from
ConstraintBase.pivotSelf
Defined in
packages/physics/constraint/ConstraintBase.ts:19
pivotTarget
• pivotTarget: Vector3
The pivot point for the target body FrameInB Origin
Inherited from
ConstraintBase.pivotTarget
Defined in
packages/physics/constraint/ConstraintBase.ts:24
rotationSelf
• rotationSelf: Quaternion
The rotation for the self body FrameInA Rotation
Inherited from
ConstraintBase.rotationSelf
Defined in
packages/physics/constraint/ConstraintBase.ts:29
rotationTarget
• rotationTarget: Quaternion
The rotation for the target body FrameInB Rotation
Inherited from
ConstraintBase.rotationTarget
Defined in
packages/physics/constraint/ConstraintBase.ts:34
disableCollisionsBetweenLinkedBodies
• disableCollisionsBetweenLinkedBodies: boolean = true
Inherited from
ConstraintBase.disableCollisionsBetweenLinkedBodies
Defined in
packages/physics/constraint/ConstraintBase.ts:36
useLinearReferenceFrame
• useLinearReferenceFrame: boolean = true
是否使用线性参考框架。 默认值 true
Defined in
packages/physics/constraint/SliderConstraint.ts:21
object3D
• object3D: Object3D = null
owner object3D
Inherited from
ConstraintBase.object3D
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional isDestroyed: boolean
Inherited from
ConstraintBase.isDestroyed
Defined in
src/components/ComponentBase.ts:38
Accessors
breakingThreshold
• get breakingThreshold(): number
断裂脉冲阈值,值越大,约束越不易断裂。
Returns
number
Inherited from
ConstraintBase.breakingThreshold
Defined in
packages/physics/constraint/ConstraintBase.ts:41
• set breakingThreshold(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Inherited from
ConstraintBase.breakingThreshold
Defined in
packages/physics/constraint/ConstraintBase.ts:45
constraint
• get constraint(): T
获取约束实例
Returns
T
Inherited from
ConstraintBase.constraint
Defined in
packages/physics/constraint/ConstraintBase.ts:87
targetRigidbody
• get targetRigidbody(): Rigidbody
目标刚体组件
Returns
Inherited from
ConstraintBase.targetRigidbody
Defined in
packages/physics/constraint/ConstraintBase.ts:119
• set targetRigidbody(value): void
Parameters
| Name | Type |
|---|---|
value | Rigidbody |
Returns
void
Inherited from
ConstraintBase.targetRigidbody
Defined in
packages/physics/constraint/ConstraintBase.ts:123
lowerLinLimit
• get lowerLinLimit(): number
线性运动的下限限制。 默认值 -1e30 表示无限制
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:59
• set lowerLinLimit(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:62
upperLinLimit
• get upperLinLimit(): number
线性运动的上限限制。 默认值 1e30 表示无限制
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:71
• set upperLinLimit(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:74
lowerAngLimit
• get lowerAngLimit(): number
角度运动的下限限制。 默认值 -Math.PI
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:83
• set lowerAngLimit(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:86
upperAngLimit
• get upperAngLimit(): number
角度运动的上限限制。 默认值 Math.PI
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:95
• set upperAngLimit(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:98
poweredLinMotor
• get poweredLinMotor(): boolean
是否启用线性马达。 默认值 false
Returns
boolean
Defined in
packages/physics/constraint/SliderConstraint.ts:107
• set poweredLinMotor(value): void
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:110
maxLinMotorForce
• get maxLinMotorForce(): number
线性马达的最大推力。 默认值 0
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:119
• set maxLinMotorForce(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:122
targetLinMotorVelocity
• get targetLinMotorVelocity(): number
线性马达的目标速度。 默认值 0
Returns
number
Defined in
packages/physics/constraint/SliderConstraint.ts:131
• set targetLinMotorVelocity(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Defined in
packages/physics/constraint/SliderConstraint.ts:134
eventDispatcher
• get eventDispatcher(): CEventDispatcher
Returns
CEventDispatcher
Inherited from
ConstraintBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set eventDispatcher(value): void
Parameters
| Name | Type |
|---|---|
value | CEventDispatcher |
Returns
void
Inherited from
ConstraintBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:28
isStart
• get isStart(): boolean
Returns
boolean
Inherited from
ConstraintBase.isStart
Defined in
src/components/ComponentBase.ts:40
transform
• get transform(): Transform
Return the Transform component attached to the Object3D.
Returns
Transform
Inherited from
ConstraintBase.transform
Defined in
src/components/ComponentBase.ts:47
enable
• get enable(): boolean
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Returns
boolean
Inherited from
ConstraintBase.enable
Defined in
src/components/ComponentBase.ts:68
• set enable(value): void
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
ConstraintBase.enable
Defined in
src/components/ComponentBase.ts:54
Methods
start
▸ start(): Promise<void>
Returns
Promise<void>
Inherited from
ConstraintBase.start
Defined in
packages/physics/constraint/ConstraintBase.ts:50
wait
▸ wait(): Promise<btSliderConstraint>
异步获取完成初始化的约束实例
Returns
Promise<btSliderConstraint>
Inherited from
ConstraintBase.wait
Defined in
packages/physics/constraint/ConstraintBase.ts:97
resetConstraint
▸ resetConstraint(): Promise<btSliderConstraint>
重置约束,销毁当前约束实例后重新创建并返回新的约束实例
Returns
Promise<btSliderConstraint>
Inherited from
ConstraintBase.resetConstraint
Defined in
packages/physics/constraint/ConstraintBase.ts:105
destroy
▸ destroy(force?): void
Parameters
| Name | Type |
|---|---|
force? | boolean |
Returns
void
Inherited from
ConstraintBase.destroy
Defined in
packages/physics/constraint/ConstraintBase.ts:127
init
▸ init(param?): void
Parameters
| Name | Type |
|---|---|
param? | any |
Returns
void
Inherited from
ConstraintBase.init
Defined in
src/components/ComponentBase.ts:112
stop
▸ stop(): void
Returns
void
Inherited from
ConstraintBase.stop
Defined in
src/components/ComponentBase.ts:114
onEnable
▸ onEnable(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onEnable
Defined in
src/components/ComponentBase.ts:115
onDisable
▸ onDisable(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onDisable
Defined in
src/components/ComponentBase.ts:116
onUpdate
▸ onUpdate(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onUpdate
Defined in
src/components/ComponentBase.ts:117
onLateUpdate
▸ onLateUpdate(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onLateUpdate
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onBeforeUpdate
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ onCompute(view?, command?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
ConstraintBase.onCompute
Defined in
src/components/ComponentBase.ts:120
onGraphic
▸ onGraphic(view?): any
Parameters
| Name | Type |
|---|---|
view? | View3D |
Returns
any
Inherited from
ConstraintBase.onGraphic
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?, currentParent?): any
Parameters
| Name | Type |
|---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
ConstraintBase.onParentChange
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child): any
Parameters
| Name | Type |
|---|---|
child | Object3D |
Returns
any
Inherited from
ConstraintBase.onAddChild
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child): any
Parameters
| Name | Type |
|---|---|
child | Object3D |
Returns
any
Inherited from
ConstraintBase.onRemoveChild
Defined in
src/components/ComponentBase.ts:124
cloneTo
▸ cloneTo(obj): void
clone component data to target object3D
Parameters
| Name | Type | Description |
|---|---|---|
obj | Object3D | target object3D |
Returns
void
Inherited from
ConstraintBase.cloneTo
Defined in
src/components/ComponentBase.ts:131
copyComponent
▸ copyComponent(from): this
Parameters
| Name | Type |
|---|---|
from | this |
Returns
this
Inherited from
ConstraintBase.copyComponent
Defined in
src/components/ComponentBase.ts:133
beforeDestroy
▸ beforeDestroy(force?): void
before release this component, object refrences are not be set null now.
Parameters
| Name | Type |
|---|---|
force? | boolean |
Returns
void
Inherited from
ConstraintBase.beforeDestroy

