public class GeometryUtils extends Object
Constructor and Description |
---|
GeometryUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
bitangent(Vector3fc v1,
Vector2fc uv1,
Vector3fc v2,
Vector2fc uv2,
Vector3fc v3,
Vector2fc uv3,
Vector3f dest)
Calculate the surface bitangent for the three supplied vertices and UV coordinates and store the result in
dest . |
static void |
normal(float v0X,
float v0Y,
float v0Z,
float v1X,
float v1Y,
float v1Z,
float v2X,
float v2Y,
float v2Z,
Vector3f dest)
Calculate the normal of a surface defined by points (v1X, v1Y, v1Z), (v2X, v2Y, v2Z) and (v3X, v3Y, v3Z)
and store it in
dest . |
static void |
normal(Vector3fc v0,
Vector3fc v1,
Vector3fc v2,
Vector3f dest)
Calculate the normal of a surface defined by points
v1 , v2 and v3 and store it in dest . |
static void |
perpendicular(float x,
float y,
float z,
Vector3f dest1,
Vector3f dest2)
Compute two arbitrary vectors perpendicular to the given normalized vector (x, y, z), and store them in
dest1 and dest2 ,
respectively. |
static void |
perpendicular(Vector3fc v,
Vector3f dest1,
Vector3f dest2)
Compute two arbitrary vectors perpendicular to the given normalized vector
v , and store them in dest1 and dest2 ,
respectively. |
static void |
tangent(Vector3fc v1,
Vector2fc uv1,
Vector3fc v2,
Vector2fc uv2,
Vector3fc v3,
Vector2fc uv3,
Vector3f dest)
Calculate the surface tangent for the three supplied vertices and UV coordinates and store the result in
dest . |
static void |
tangentBitangent(Vector3fc v1,
Vector2fc uv1,
Vector3fc v2,
Vector2fc uv2,
Vector3fc v3,
Vector2fc uv3,
Vector3f destTangent,
Vector3f destBitangent)
Calculate the surface tangent and bitangent for the three supplied vertices and UV coordinates and store the result in
dest . |
public static void perpendicular(float x, float y, float z, Vector3f dest1, Vector3f dest2)
dest1
and dest2
,
respectively.
The computed vectors will themselves be perpendicular to each another and normalized. So the tree vectors (x, y, z), dest1
and
dest2
form an orthonormal basis.
x
- the x coordinate of the normalized input vectory
- the y coordinate of the normalized input vectorz
- the z coordinate of the normalized input vectordest1
- will hold the first perpendicular vectordest2
- will hold the second perpendicular vectorpublic static void perpendicular(Vector3fc v, Vector3f dest1, Vector3f dest2)
v
, and store them in dest1
and dest2
,
respectively.
The computed vectors will themselves be perpendicular to each another and normalized. So the tree vectors v
, dest1
and
dest2
form an orthonormal basis.
v
- the normalized
input vectordest1
- will hold the first perpendicular vectordest2
- will hold the second perpendicular vectorpublic static void normal(Vector3fc v0, Vector3fc v1, Vector3fc v2, Vector3f dest)
v1
, v2
and v3
and store it in dest
.v0
- the first positionv1
- the second positionv2
- the third positiondest
- will hold the resultpublic static void normal(float v0X, float v0Y, float v0Z, float v1X, float v1Y, float v1Z, float v2X, float v2Y, float v2Z, Vector3f dest)
dest
.v0X
- the x coordinate of the first positionv0Y
- the y coordinate of the first positionv0Z
- the z coordinate of the first positionv1X
- the x coordinate of the second positionv1Y
- the y coordinate of the second positionv1Z
- the z coordinate of the second positionv2X
- the x coordinate of the third positionv2Y
- the y coordinate of the third positionv2Z
- the z coordinate of the third positiondest
- will hold the resultpublic static void tangent(Vector3fc v1, Vector2fc uv1, Vector3fc v2, Vector2fc uv2, Vector3fc v3, Vector2fc uv3, Vector3f dest)
dest
.v1
- XYZ of first vertexuv1
- UV of first vertexv2
- XYZ of second vertexuv2
- UV of second vertexv3
- XYZ of third vertexuv3
- UV of third vertexdest
- the tangent will be stored herepublic static void bitangent(Vector3fc v1, Vector2fc uv1, Vector3fc v2, Vector2fc uv2, Vector3fc v3, Vector2fc uv3, Vector3f dest)
dest
.v1
- XYZ of first vertexuv1
- UV of first vertexv2
- XYZ of second vertexuv2
- UV of second vertexv3
- XYZ of third vertexuv3
- UV of third vertexdest
- the binormal will be stored herepublic static void tangentBitangent(Vector3fc v1, Vector2fc uv1, Vector3fc v2, Vector2fc uv2, Vector3fc v3, Vector2fc uv3, Vector3f destTangent, Vector3f destBitangent)
dest
.v1
- XYZ of first vertexuv1
- UV of first vertexv2
- XYZ of second vertexuv2
- UV of second vertexv3
- XYZ of third vertexuv3
- UV of third vertexdestTangent
- the tangent will be stored heredestBitangent
- the bitangent will be stored hereCopyright © 2015–2016 JOML. All rights reserved.