|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.math.VectorUtil
public class VectorUtil
| Nested Class Summary | |
|---|---|
static class |
VectorUtil.Winding
|
| Field Summary | |
|---|---|
static int |
COLLINEAR
|
| Constructor Summary | |
|---|---|
VectorUtil()
|
|
| Method Summary | |
|---|---|
static float |
area(ArrayList<? extends Vert2fImmutable> vertices)
Computes the area of a list of vertices to check if ccw |
static boolean |
ccw(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
Check if points are in ccw order |
static boolean |
checkCollinear(float[] v1,
float[] v2,
float[] v3)
Check if three vertices are colliniear |
static boolean |
checkEquality(float[] v1,
float[] v2)
Check equality of 2 vec3 vectors |
static boolean |
checkEqualityVec2(float[] v1,
float[] v2)
Check equality of 2 vec2 vectors |
static float[] |
colMatrixVectorMult(float[] colMatrix,
float[] vec)
Column Matrix Vector multiplication |
static float |
computeDeterminant(float[] a,
float[] b,
float[] c)
Compute the determinant of 3 vectors |
static float |
computeLength(float[] p0,
float[] point)
Compute distance between 2 points |
static float[] |
computeVector(float[] v1,
float[] v2)
Compute Vector |
static float[] |
cross(float[] vec1,
float[] vec2)
cross product vec1 x vec2 |
static float |
dot(float[] vec1,
float[] vec2)
compute the dot product of two points |
static VectorUtil.Winding |
getWinding(ArrayList<? extends Vert2fImmutable> vertices)
Compute the general winding of the vertices |
static VectorUtil.Winding |
getWinding(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
Compute the winding of given points |
static boolean |
inCircle(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
Check if vertices in triangle circumcircle |
static float[] |
line2lineIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
Compute intersection between two lines |
static float[] |
mid(float[] p1,
float[] p2)
Calculate the midpoint of two points |
static float |
mid(float p1,
float p2)
Calculate the midpoint of two values |
static float |
norm(float[] vec)
Compute the norm of a vector |
static float[] |
normalize(float[] vector)
Normalize a vector |
static float[] |
rowMatrixVectorMult(float[] rawMatrix,
float[] vec)
Matrix Vector multiplication |
static float[] |
scale(float[] vector,
float scale)
Scales a vector by param |
static float[] |
seg2SegIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
Compute intersection between two segments |
static boolean |
tri2SegIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d,
Vert2fImmutable e)
Check if a segment intersects with a triangle |
static float |
triArea(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
Computes oriented area of a triangle |
static float[] |
vectorAdd(float[] v1,
float[] v2)
Adds to vectors |
static boolean |
vertexInTriangle(float[] a,
float[] b,
float[] c,
float[] p)
Check if a vertex is in triangle using barycentric coordinates computation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COLLINEAR
| Constructor Detail |
|---|
public VectorUtil()
| Method Detail |
|---|
public static float dot(float[] vec1,
float[] vec2)
vec1 - vector 1vec2 - vector 2
public static float[] normalize(float[] vector)
vector - input vector
public static float[] scale(float[] vector,
float scale)
vector - input vectorscale - constant to scale by
public static float[] vectorAdd(float[] v1,
float[] v2)
v1 - vector 1v2 - vector 2
public static float[] cross(float[] vec1,
float[] vec2)
vec1 - vector 1vec2 - vecttor 2
public static float[] colMatrixVectorMult(float[] colMatrix,
float[] vec)
colMatrix - column matrix (4x4)vec - vector(x,y,z)
public static float[] rowMatrixVectorMult(float[] rawMatrix,
float[] vec)
rawMatrix - column matrix (4x4)vec - vector(x,y,z)
public static float mid(float p1,
float p2)
p1 - first valuep2 - second vale
public static float[] mid(float[] p1,
float[] p2)
p1 - first pointp2 - second point
public static float norm(float[] vec)
vec - vector
public static float computeLength(float[] p0,
float[] point)
p0 - a ref point on the linevec - vector representing the direction of the linepoint - the point to compute the relative distance of
public static boolean checkEquality(float[] v1,
float[] v2)
v1 - vertex 1v2 - vertex 2
public static boolean checkEqualityVec2(float[] v1,
float[] v2)
v1 - vertex 1v2 - vertex 2
public static float computeDeterminant(float[] a,
float[] b,
float[] c)
a - vector 1b - vector 2c - vector 3
public static boolean checkCollinear(float[] v1,
float[] v2,
float[] v3)
v1 - vertex 1v2 - vertex 2v3 - vertex 3
public static float[] computeVector(float[] v1,
float[] v2)
v1 - vertex 1v2 - vertex2 2
public static boolean inCircle(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
a - triangle vertex 1b - triangle vertex 2c - triangle vertex 3d - vertex in question
public static float triArea(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
a - first vertexb - second vertexc - third vertex
public static boolean vertexInTriangle(float[] a,
float[] b,
float[] c,
float[] p)
a - first triangle vertexb - second triangle vertexc - third triangle vertexp - the vertex in question
public static boolean ccw(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
a - first vertexb - second vertexc - third vertex
public static VectorUtil.Winding getWinding(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c)
a - first vertexb - second vertexc - third vertex
public static float area(ArrayList<? extends Vert2fImmutable> vertices)
vertices -
public static VectorUtil.Winding getWinding(ArrayList<? extends Vert2fImmutable> vertices)
vertices - array of Vertices
VectorUtil.Winding
public static float[] seg2SegIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
a - vertex 1 of first segmentb - vertex 2 of first segmentc - vertex 1 of second segmentd - vertex 2 of second segment
public static float[] line2lineIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d)
a - vertex 1 of first lineb - vertex 2 of first linec - vertex 1 of second lined - vertex 2 of second line
public static boolean tri2SegIntersection(Vert2fImmutable a,
Vert2fImmutable b,
Vert2fImmutable c,
Vert2fImmutable d,
Vert2fImmutable e)
a - vertex 1 of the triangleb - vertex 2 of the trianglec - vertex 3 of the triangled - vertex 1 of first segmente - vertex 2 of first segment
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||