Table of Contents

Class SoftBody

Namespace
Jitter2.SoftBodies
Assembly
Jitter2.dll

Represents a soft body in the physics simulation. A soft body is composed of vertices (rigid bodies), springs (constraints), and shapes.

public class SoftBody
Inheritance
SoftBody
Inherited Members

Constructors

SoftBody(World)

Initializes a new instance of the SoftBody class.

public SoftBody(World world)

Parameters

world World

The world in which the soft body will be created.

Properties

IsActive

Gets a value indicating whether the soft body is active. A soft body is considered active if its first vertex is active.

public bool IsActive { get; }

Property Value

bool

Shapes

Gets the list of shapes that define the geometry of the soft body.

public List<SoftBodyShape> Shapes { get; }

Property Value

List<SoftBodyShape>

Springs

Gets the list of springs (constraints) that connect the vertices of the soft body.

public List<Constraint> Springs { get; }

Property Value

List<Constraint>

Vertices

Gets the list of vertices (rigid bodies) that make up the soft body.

public List<RigidBody> Vertices { get; }

Property Value

List<RigidBody>

World

Gets the world in which the soft body exists.

public World World { get; }

Property Value

World

Methods

AddShape(SoftBodyShape)

Adds a shape to the soft body and registers it with the world's dynamic tree.

public void AddShape(SoftBodyShape shape)

Parameters

shape SoftBodyShape

The shape to add.

AddSpring(Constraint)

Adds a spring (constraint) to the soft body.

public void AddSpring(Constraint constraint)

Parameters

constraint Constraint

The constraint to add.

Destroy()

Destroys the soft body, removing all its components from the simulation world.

public virtual void Destroy()

WorldOnPostStep(float)

Called after each world step to update the activation state of the soft body's shapes.

protected virtual void WorldOnPostStep(float dt)

Parameters

dt float

The time step.