Package jme3utilities.math
Class MyVolume
java.lang.Object
jme3utilities.math.MyVolume
Utility methods for computing volumes of shapes. Aside from test cases, all
methods should be public and static.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic floatboxVolume(com.jme3.math.Vector3f halfExtents) Compute the volume of an axis-aligned box with specified half-extents.static floatcapsuleVolume(float radius, float height) Compute the volume of a capsule with the specified radius and height.static floatconeVolume(float radius, float height) Compute the volume of a cone with the specified radius and height.static floatcylinderVolume(com.jme3.math.Vector3f halfExtents) Compute the volume of an axis-aligned cylinder with specified half-extents.static floatsphereVolume(float radius) Compute the volume of a sphere with the specified radius.static doubletetrahedronVolume(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.
-
Field Details
-
logger
message logger for this class
-
-
Method Details
-
boxVolume
public static float boxVolume(com.jme3.math.Vector3f halfExtents) Compute the volume of an axis-aligned box with specified half-extents.- Parameters:
halfExtents- (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- (≥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- (≥0)height- (≥0)- Returns:
- the volume (≥0)
-
cylinderVolume
public static float cylinderVolume(com.jme3.math.Vector3f halfExtents) Compute the volume of an axis-aligned cylinder with specified half-extents.- Parameters:
halfExtents- (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- (≥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- location of the first vertex (not null, unaffected)v2- location of the 2nd vertex (not null, unaffected)v3- location of the 3rd vertex (not null, unaffected)v4- location of the 4th vertex (not null, unaffected)- Returns:
- the volume (≥0)
-