|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.imp3d.VertexArray
public abstract class VertexArray
This abstract base class contains a list of vertex coordinates.
Field Summary | |
---|---|
int |
dimension
The number of float -values per vertex in
vertices . |
java.lang.Object |
userObject
This field may be used freely by user code. |
FloatList |
vertices
This list contains the vertex coordinates. |
Constructor Summary | |
---|---|
VertexArray()
|
Method Summary | |
---|---|
int |
addVertex(float x,
float y,
float z)
|
int |
addVertex(Tuple3d v)
|
int |
addVertex(Tuple3f v)
|
void |
computeNormal(float[] out,
int v1,
int v2,
int v3)
Computes the (unnormalized) normal vector for the triangle (v1, v2, v3) . |
void |
freeArrays()
|
void |
init(int dimension)
Clears this vertex array and initializes the dimension -value. |
boolean |
wasCleared()
Tests whether this list was cleared previously. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int dimension
float
-values per vertex in
vertices
.
public java.lang.Object userObject
public FloatList vertices
dimension
float
-values for each vertex.
Constructor Detail |
---|
public VertexArray()
Method Detail |
---|
public int addVertex(float x, float y, float z)
public int addVertex(Tuple3d v)
public int addVertex(Tuple3f v)
public void computeNormal(float[] out, int v1, int v2, int v3)
(v1, v2, v3)
. The corners are specified by the
vertex indices v1, v2, v3
(which this method multiplies by dimension
to obtain
indices in the list vertices
). The cross product of
the vector from v1
to v2
with the
vector from v1
to v3
is computed and
place in out
.
out
- the resulting normal vector is placed in herev1
- the vertex index of the first cornerv2
- the vertex index of the second cornerv3
- the vertex index of the third cornerpublic void freeArrays()
public void init(int dimension)
dimension
-value.
dimension
- the new value for dimension
public boolean wasCleared()
true
iff the init
-method
has been invoked between the last invocation of wasCleared
and this invocation.
true
if this list was cleared
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |