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
bodySoftBodyThe soft body this shape belongs to.
v1RigidBodyThe first vertex.
v2RigidBodyThe second vertex.
v3RigidBodyThe third vertex.
Properties
Thickness
Gets or sets the thickness of the triangle.
public float Thickness { get; set; }
Property Value
Velocity
Gets the velocity of the entity, used for bounding box expansion.
public override JVector Velocity { get; }
Property Value
Vertex1
Gets the first vertex (rigid body) of the triangle.
public RigidBody Vertex1 { get; }
Property Value
Vertex2
Gets the second vertex (rigid body) of the triangle.
public RigidBody Vertex2 { get; }
Property Value
Vertex3
Gets the third vertex (rigid body) of the triangle.
public RigidBody Vertex3 { 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.