Class TriangleShape

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

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

    • TriangleShape

      public TriangleShape(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z, float convexRadius)
      Instantiate a shape with the specified vertices and convex radius.
      Parameters:
      v1x - the X coordinate of the first vertex
      v1y - the Y coordinate of the first vertex
      v1z - the Z coordinate of the first vertex
      v2x - the X coordinate of the 2nd vertex
      v2y - the Y coordinate of the 2nd vertex
      v2z - the Z coordinate of the 2nd vertex
      v3x - the X coordinate of the 3rd vertex
      v3y - the Y coordinate of the 3rd vertex
      v3z - the Z coordinate of the 3rd vertex
      convexRadius - the desired convex radius (default=0)
    • 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)