Class TriangleShapeSettings

All Implemented Interfaces:
ConstConvexShapeSettings, ConstJoltPhysicsObject, ConstSerializableObject, ConstShapeSettings, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class TriangleShapeSettings extends ConvexShapeSettings
Settings used to construct a TriangleShape.
  • Constructor Details

    • TriangleShapeSettings

      public TriangleShapeSettings()
      Instantiate default settings.
    • TriangleShapeSettings

      public TriangleShapeSettings(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z, float convexRadius, PhysicsMaterial material)
      Instantiate settings for the specified vertices.
      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)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
    • TriangleShapeSettings

      public TriangleShapeSettings(TriangleShapeSettings original)
      Instantiate a copy of the specified settings.
      Parameters:
      original - the settings to copy (not null, unaffected)
    • TriangleShapeSettings

      public TriangleShapeSettings(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3)
      Instantiate settings for 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)
    • TriangleShapeSettings

      public TriangleShapeSettings(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3, float convexRadius)
      Instantiate settings for 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)
      convexRadius - the desired convex radius (default=0)
    • TriangleShapeSettings

      public TriangleShapeSettings(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3, float convexRadius, PhysicsMaterial material)
      Instantiate settings for 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)
      convexRadius - the desired convex radius (default=0)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
  • Method Details

    • getConvexRadius

      public float getConvexRadius()
      Return the convex radius. The settings are unaffected. (native attribute: mConvexRadius)
      Returns:
      the convex radius (≥0)
    • getV1

      public Vec3 getV1()
      Copy the location of the first vertex. The settings are unaffected. (native attribute: mV1)
      Returns:
      a new location vector
    • getV2

      public Vec3 getV2()
      Copy the location of the first vertex. The settings are unaffected. (native attribute: mV2)
      Returns:
      a new location vector
    • getV3

      public Vec3 getV3()
      Copy the location of the 3rd vertex. The settings are unaffected. (native attribute: mV3)
      Returns:
      a new location vector
    • set

      public void set(TriangleShapeSettings source)
      Copy the argument to the current settings.
      Parameters:
      source - the settings to copy (not null, unaffected)
    • setConvexRadius

      public void setConvexRadius(float radius)
      Alter the convex radius. (native attribute: mConvexRadius)
      Parameters:
      radius - the desired convex radius (≥0, default=0)
    • setV1

      public void setV1(float x, float y, float z)
      Relocate the first vertex. (native attribute: mV1)
      Parameters:
      x - the desired X coordinate (default=0)
      y - the desired Y coordinate (default=0)
      z - the desired Z coordinate (default=0)
    • setV2

      public void setV2(float x, float y, float z)
      Relocate the 2nd vertex. (native attribute: mV2)
      Parameters:
      x - the desired X coordinate (default=0)
      y - the desired Y coordinate (default=0)
      z - the desired Z coordinate (default=0)
    • setV3

      public void setV3(float x, float y, float z)
      Relocate the 3rd vertex. (native attribute: mV3)
      Parameters:
      x - the desired X coordinate (default=0)
      y - the desired Y coordinate (default=0)
      z - the desired Z coordinate (default=0)