Class TriangleShape

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class TriangleShape extends ConvexShape
A Shape to represent a single triangle.
  • Constructor Details

    • TriangleShape

      public TriangleShape(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3)
      Instantiate a shape with the specified vertices.
      Parameters:
      v1 - the location of the first vertex (not null, unaffected)
      v2 - the location of the 2nd vertex (not null, unaffected)
      v3 - the location of the 3rd vertex (not null, unaffected)
    • TriangleShape

      public TriangleShape(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3, float convexRadius)
      Instantiate a shape with the specified vertices and convex radius.
      Parameters:
      v1 - the location of the first vertex (not null, unaffected)
      v2 - the location of the 2nd vertex (not null, unaffected)
      v3 - the location of the 3rd vertex (not null, unaffected)
      convexRadius - the desired convex radius (default=0)
  • Method Details

    • getConvexRadius

      public float getConvexRadius()
      Return the convex radius. The shape is unaffected.
      Returns:
      the radius (≥0)