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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    boxVolume(com.jme3.math.Vector3f halfExtents)
    Compute the volume of a box with the specified half extents.
    static float
    capsuleVolume(float radius, float height)
    Compute the volume of a capsule with the specified radius and height.
    static float
    coneVolume(float radius, float height)
    Compute the volume of a cone with the specified radius and height.
    static float
    cylinderVolume(com.jme3.math.Vector3f halfExtents)
    Compute the volume of a cylinder with specified half extents.
    static float
    sphereVolume(float radius)
    Compute the volume of a sphere with the specified radius.
    static double
    tetrahedronVolume(com.jme3.math.Vector3f v1, com.jme3.math.Vector3f v2, com.jme3.math.Vector3f v3, com.jme3.math.Vector3f v4)
    Determine the volume of the specified tetrahedron.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

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

    • boxVolume

      public static float boxVolume(com.jme3.math.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(com.jme3.math.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(com.jme3.math.Vector3f v1, com.jme3.math.Vector3f v2, com.jme3.math.Vector3f v3, com.jme3.math.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)