Skip to content

Class: ClothSoftbody

Hierarchy

  • SoftbodyBase

    ClothSoftbody

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ClothSoftbody(): ClothSoftbody

Returns

ClothSoftbody

Inherited from

SoftbodyBase.constructor

Properties

clothCorners

clothCorners: [Vector3, Vector3, Vector3, Vector3]

布料的四个角,默认以平面法向量计算各角。

Defined in

packages/physics/softbody/ClothSoftbody.ts:22


fixNodeIndices

fixNodeIndices: number[] | CornerType[] = []

固定节点索引。

Defined in

packages/physics/softbody/ClothSoftbody.ts:27


anchorRigidbody

anchorRigidbody: Rigidbody

添加锚点时需要的刚体。

Defined in

packages/physics/softbody/ClothSoftbody.ts:32


anchorIndices

anchorIndices: number[] | CornerType[] = []

布料的锚点。

Defined in

packages/physics/softbody/ClothSoftbody.ts:37


anchorPosition

anchorPosition: Vector3

仅在设置 anchorRigidbody 后有效,表示布料软体相对刚体的位置。

Defined in

packages/physics/softbody/ClothSoftbody.ts:42


anchorRotation

anchorRotation: Vector3

仅在设置 anchorRigidbody 后有效,表示布料软体相对刚体的旋转。

Defined in

packages/physics/softbody/ClothSoftbody.ts:47


mass

mass: number = 1

软体的总质量,默认值为 1

Inherited from

SoftbodyBase.mass

Defined in

packages/physics/softbody/SoftbodyBase.ts:17


margin

margin: number = 0.15

碰撞边距,默认值为 0.15

Inherited from

SoftbodyBase.margin

Defined in

packages/physics/softbody/SoftbodyBase.ts:22


group

group: number = 1

碰撞组,默认值为 1

Inherited from

SoftbodyBase.group

Defined in

packages/physics/softbody/SoftbodyBase.ts:27


mask

mask: number = -1

碰撞掩码,默认值为 -1

Inherited from

SoftbodyBase.mask

Defined in

packages/physics/softbody/SoftbodyBase.ts:32


influence

influence: number = 1

锚点的影响力。影响力值越大,软体节点越紧密地跟随刚体的运动。通常,这个值在0到1之间。默认值为 1

Inherited from

SoftbodyBase.influence

Defined in

packages/physics/softbody/SoftbodyBase.ts:37


disableCollision

disableCollision: boolean = false

是否禁用与锚定刚体之间的碰撞,默认值为 false

Inherited from

SoftbodyBase.disableCollision

Defined in

packages/physics/softbody/SoftbodyBase.ts:42


object3D

object3D: Object3D = null

owner object3D

Inherited from

SoftbodyBase.object3D

Defined in

src/components/ComponentBase.ts:17


isDestroyed

Optional isDestroyed: boolean

Inherited from

SoftbodyBase.isDestroyed

Defined in

src/components/ComponentBase.ts:38

Accessors

activationState

set activationState(value): void

设置软体激活状态。

Parameters

NameType
valueActivationState

Returns

void

Inherited from

SoftbodyBase.activationState

Defined in

packages/physics/softbody/SoftbodyBase.ts:47


btBodyInited

get btBodyInited(): boolean

Returns

boolean

Inherited from

SoftbodyBase.btBodyInited

Defined in

packages/physics/softbody/SoftbodyBase.ts:51


btSoftBody

get btSoftBody(): btSoftBody

Returns

btSoftBody

Inherited from

SoftbodyBase.btSoftBody

Defined in

packages/physics/softbody/SoftbodyBase.ts:55


eventDispatcher

get eventDispatcher(): CEventDispatcher

Returns

CEventDispatcher

Inherited from

SoftbodyBase.eventDispatcher

Defined in

src/components/ComponentBase.ts:23

set eventDispatcher(value): void

Parameters

NameType
valueCEventDispatcher

Returns

void

Inherited from

SoftbodyBase.eventDispatcher

Defined in

src/components/ComponentBase.ts:28


isStart

get isStart(): boolean

Returns

boolean

Inherited from

SoftbodyBase.isStart

Defined in

src/components/ComponentBase.ts:40


transform

get transform(): Transform

Return the Transform component attached to the Object3D.

Returns

Transform

Inherited from

SoftbodyBase.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

SoftbodyBase.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

NameType
valueboolean

Returns

void

Inherited from

SoftbodyBase.enable

Defined in

src/components/ComponentBase.ts:54

Methods

start

start(): Promise<void>

Returns

Promise<void>

Overrides

SoftbodyBase.start

Defined in

packages/physics/softbody/ClothSoftbody.ts:49


applyFixedNodes

applyFixedNodes(fixedNodeIndices): void

固定软体节点。

Parameters

NameTypeDescription
fixedNodeIndicesnumber[] | CornerType[]表示需要固定的节点索引或 CornerType 数组。

Returns

void

Overrides

SoftbodyBase.applyFixedNodes

Defined in

packages/physics/softbody/ClothSoftbody.ts:192


clearAnchors

clearAnchors(): void

清除锚点,软体将会从附加的刚体上脱落

Returns

void

Defined in

packages/physics/softbody/ClothSoftbody.ts:202


onUpdate

onUpdate(): void

Returns

void

Overrides

SoftbodyBase.onUpdate

Defined in

packages/physics/softbody/ClothSoftbody.ts:209


destroy

destroy(force?): void

Parameters

NameType
force?boolean

Returns

void

Overrides

SoftbodyBase.destroy

Defined in

packages/physics/softbody/ClothSoftbody.ts:243


init

init(): void

Returns

void

Inherited from

SoftbodyBase.init

Defined in

packages/physics/softbody/SoftbodyBase.ts:59


wait

wait(): Promise<btSoftBody>

Asynchronously retrieves the fully initialized soft body instance.

Returns

Promise<btSoftBody>

Inherited from

SoftbodyBase.wait

Defined in

packages/physics/softbody/SoftbodyBase.ts:95


appendAnchor

appendAnchor(nodeIndex, targetRigidbody, disCollision?, influence?): void

Wraps the native soft body's appendAnchor method to anchor a node to a rigid body.

Parameters

NameTypeDescription
nodeIndexnumberIndex of the node to anchor.
targetRigidbodyRigidbodyThe rigid body to anchor to.
disCollision?booleanOptional. Disable collisions if true.
influence?numberOptional. Anchor's influence.

Returns

void

Inherited from

SoftbodyBase.appendAnchor

Defined in

packages/physics/softbody/SoftbodyBase.ts:107


clearFixedNodes

clearFixedNodes(index?): void

清除固定节点

Parameters

NameTypeDescription
index?number需要清除的节点索引,如果未提供,则清除所有节点。

Returns

void

Inherited from

SoftbodyBase.clearFixedNodes

Defined in

packages/physics/softbody/SoftbodyBase.ts:140


stop

stop(): void

Returns

void

Inherited from

SoftbodyBase.stop

Defined in

src/components/ComponentBase.ts:114


onEnable

onEnable(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

SoftbodyBase.onEnable

Defined in

src/components/ComponentBase.ts:115


onDisable

onDisable(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

SoftbodyBase.onDisable

Defined in

src/components/ComponentBase.ts:116


onLateUpdate

onLateUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

SoftbodyBase.onLateUpdate

Defined in

src/components/ComponentBase.ts:118


onBeforeUpdate

onBeforeUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

SoftbodyBase.onBeforeUpdate

Defined in

src/components/ComponentBase.ts:119


onCompute

onCompute(view?, command?): any

Parameters

NameType
view?View3D
command?GPUCommandEncoder

Returns

any

Inherited from

SoftbodyBase.onCompute

Defined in

src/components/ComponentBase.ts:120


onGraphic

onGraphic(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

SoftbodyBase.onGraphic

Defined in

src/components/ComponentBase.ts:121


onParentChange

onParentChange(lastParent?, currentParent?): any

Parameters

NameType
lastParent?Object3D
currentParent?Object3D

Returns

any

Inherited from

SoftbodyBase.onParentChange

Defined in

src/components/ComponentBase.ts:122


onAddChild

onAddChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

SoftbodyBase.onAddChild

Defined in

src/components/ComponentBase.ts:123


onRemoveChild

onRemoveChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

SoftbodyBase.onRemoveChild

Defined in

src/components/ComponentBase.ts:124


cloneTo

cloneTo(obj): void

clone component data to target object3D

Parameters

NameTypeDescription
objObject3Dtarget object3D

Returns

void

Inherited from

SoftbodyBase.cloneTo

Defined in

src/components/ComponentBase.ts:131


copyComponent

copyComponent(from): this

Parameters

NameType
fromthis

Returns

this

Inherited from

SoftbodyBase.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

NameType
force?boolean

Returns

void

Inherited from

SoftbodyBase.beforeDestroy

Defined in

src/components/ComponentBase.ts:200

Released under the MIT License