Package jme3utilities.math
Class MyVolume
java.lang.Object
jme3utilities.math.MyVolume
Utility methods for computing volumes of shapes. All methods should be public
and static.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
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
(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
(Vector3f v1, Vector3f v2, Vector3f v3, Vector3f v4) Determine the volume of the specified tetrahedron.
-
Field Details
-
logger
message logger for this class
-
-
Method Details
-
boxVolume
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
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
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)
-