TxSoftBody - Scripting API - Documents - Truss Physics
/ Documents / Scripting API / TxSoftBody >

TxSoftBody class

Description

Soft body component class

Details

Game object component. Controls the object position through the Truss Physics simulation. Works with MeshFilter component to deform its mesh. The component uses a TxTruss asset to define the object physic model and collision shape.

Properties

trussTxTruss asset of the soft body
linearVelocityLinear velocity of the centre of mass of the soft body
angularVelocityAngular velocity of the soft body rotation around the centre of mass
isActiveActivation state of the soft body
nodeCountNumber of nodes of the soft body
nodePositionArray of current positions of the soft body nodes
nodeLocalPositionArray of current local positions of the soft body nodes
nodeVelocityArray of current velocities of the soft body nodes
linkCountNumber of links of the soft body nodes
linkLengthArray of current link lengths of the soft body
linkPlasticArray of current link plastic deformations of the soft body
mattersArray of matters of the soft body

Methods

ActivateActivates the soft body
ApplyImpulseApplies an impulse to the centre of mass, a node, or a point on a face of the soft body
ResetGroupRemoves the soft body from its group

Events

onBeforeStepRaised before the simulation step
onAfterStepRaised after the simulation step
onAfterUpdateRaised on each frame after the body transformation update
onCollisionRaised after the simulation step for each body this body collides with