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
bodySoftBodyThe soft body this shape belongs to.
v1RigidBodyThe first vertex.
v2RigidBodyThe second vertex.
v3RigidBodyThe third vertex.
v4RigidBodyThe fourth vertex.
Properties
Velocity
Gets the velocity of the entity, used for bounding box expansion.
public override JVector Velocity { get; }
Property Value
Vertices
Gets the four vertices (rigid bodies) of the tetrahedron.
public RigidBody[] Vertices { get; }
Property Value
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
pointJVectorA 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
posJVectorThe 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
directionJVectorThe search direction in local space. Does not need to be normalized.
resultJVectorThe 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
dtfloatThe timestep for velocity-based expansion. Default is zero.