Table of Contents

Class SoftBodyTetrahedron

Namespace
Jitter2.SoftBodies
Assembly
Jitter2.dll

Represents a tetrahedral shape in a soft body simulation.

public sealed class SoftBodyTetrahedron : SoftBodyShape, IDynamicTreeProxy, IPartitionedSetIndex, IUpdatableBoundingBox, ISupportMappable, IRayCastable, ISweepTestable, IDistanceTestable
Inheritance
SoftBodyTetrahedron
Implements
Inherited Members

Constructors

SoftBodyTetrahedron(SoftBody, RigidBody, RigidBody, RigidBody, RigidBody)

Initializes a new instance of the SoftBodyTetrahedron class.

public SoftBodyTetrahedron(SoftBody body, RigidBody v1, RigidBody v2, RigidBody v3, RigidBody v4)

Parameters

body SoftBody

The soft body this shape belongs to.

v1 RigidBody

The first vertex.

v2 RigidBody

The second vertex.

v3 RigidBody

The third vertex.

v4 RigidBody

The fourth vertex.

Properties

Velocity

Gets the velocity of the entity, used for bounding box expansion.

public override JVector Velocity { get; }

Property Value

JVector

Vertices

Gets the four vertices (rigid bodies) of the tetrahedron.

public RigidBody[] Vertices { get; }

Property Value

RigidBody[]

Methods

GetCenter(out JVector)

Computes a point deep within the shape, used as an initial search point in GJK-based algorithms.

public override void GetCenter(out JVector point)

Parameters

point JVector

A point guaranteed to be inside the convex hull, typically the center of mass.

GetClosest(in JVector)

Gets the rigid body closest to the specified position.

public override RigidBody GetClosest(in JVector pos)

Parameters

pos JVector

The position in world coordinates.

Returns

RigidBody

The closest rigid body (vertex) of this shape.

SupportMap(in JVector, out JVector)

Computes the point on the shape that is furthest in the specified direction.

public override void SupportMap(in JVector direction, out JVector result)

Parameters

direction JVector

The search direction in local space. Does not need to be normalized.

result JVector

The point on the shape's surface furthest along direction.

UpdateWorldBoundingBox(float)

Recomputes the world-space bounding box.

public override void UpdateWorldBoundingBox(float dt = 0)

Parameters

dt float

The timestep for velocity-based expansion. Default is zero.