Table of Contents

Class SoftBodyTriangle

Namespace
Jitter2.SoftBodies
Assembly
Jitter2.dll

Represents a triangular shape in a soft body simulation.

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

Constructors

SoftBodyTriangle(SoftBody, RigidBody, RigidBody, RigidBody)

Initializes a new instance of the SoftBodyTriangle class.

public SoftBodyTriangle(SoftBody body, RigidBody v1, RigidBody v2, RigidBody v3)

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.

Properties

Thickness

Gets or sets the thickness of the triangle.

public float Thickness { get; set; }

Property Value

float

Velocity

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

public override JVector Velocity { get; }

Property Value

JVector

Vertex1

Gets the first vertex (rigid body) of the triangle.

public RigidBody Vertex1 { get; }

Property Value

RigidBody

Vertex2

Gets the second vertex (rigid body) of the triangle.

public RigidBody Vertex2 { get; }

Property Value

RigidBody

Vertex3

Gets the third vertex (rigid body) of the triangle.

public RigidBody Vertex3 { 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.