Class MyVolume

java.lang.Object
jme3utilities.math.MyVolume

public final class MyVolume extends Object
Utility methods for computing volumes of shapes. All methods should be public and static.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Method Details

    • boxVolume

      public static float boxVolume(Vector3f halfExtents)
      Compute the volume of a box with the specified half extents.
      Parameters:
      halfExtents - the half extents on each local axis (not null, all components ≥0, unaffected)
      Returns:
      volume (ge;0)
    • capsuleVolume

      public static float capsuleVolume(float radius, float height)
      Compute the volume of a capsule with the specified radius and height.
      Parameters:
      radius - the radius of the capsule (≥0)
      height - the height of the cylindrical portion (≥0)
      Returns:
      the volume (≥0)
    • coneVolume

      public static float coneVolume(float radius, float height)
      Compute the volume of a cone with the specified radius and height.
      Parameters:
      radius - the radius of the cone (≥0)
      height - the height of the cone (≥0)
      Returns:
      the volume (≥0)
    • cylinderVolume

      public static float cylinderVolume(Vector3f halfExtents)
      Compute the volume of a cylinder with specified half extents.
      Parameters:
      halfExtents - the half extents on each local axis (not null, all components ≥0, unaffected)
      Returns:
      the volume (≥0)
    • sphereVolume

      public static float sphereVolume(float radius)
      Compute the volume of a sphere with the specified radius.
      Parameters:
      radius - the radius of the sphere (≥0)
      Returns:
      the volume (≥0)
    • tetrahedronVolume

      public static double tetrahedronVolume(Vector3f v1, Vector3f v2, Vector3f v3, Vector3f v4)
      Determine the volume of the specified tetrahedron.
      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)
      v4 - the location of the 4th vertex (not null, unaffected)
      Returns:
      the volume (≥0)