|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object AbstractTarget<R> FaceTarget<R>
public abstract class FaceTarget<R extends Renderable>
a target that relies on faces to represent geometry. The faces used by this target are polygons with three or more coplanar vertices. TODO: this currently produces faces that are not convex
Nested Class Summary | |
---|---|
protected static class |
FaceTarget.Face
mutable representation of a face |
protected static class |
FaceTarget.IsolatedTriangle
|
Field Summary |
---|
Fields inherited from class AbstractTarget |
---|
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config |
Constructor Summary | |
---|---|
FaceTarget()
|
Method Summary | |
---|---|
void |
beginObject(WorldObject object)
announces the begin of the draw* calls for a WorldObject . |
protected static Collection<FaceTarget.Face> |
combineTrianglesToFaces(Collection<FaceTarget.IsolatedTriangle> isolatedTriangles)
|
protected static FaceTarget.Face |
createFaceFromTriangle(FaceTarget.IsolatedTriangle t)
|
void |
drawConvexPolygon(Material material,
List<VectorXYZ> vs,
List<List<VectorXZ>> texCoordLists)
draws a convex polygon |
abstract void |
drawFace(Material material,
List<VectorXYZ> vs,
List<VectorXYZ> normals,
List<List<VectorXZ>> texCoordLists)
|
void |
drawTriangles(Material material,
Collection<? extends TriangleXYZ> triangles,
List<List<VectorXZ>> texCoordLists)
draws triangles. |
void |
drawTrianglesWithNormals(Material material,
Collection<? extends TriangleXYZWithNormals> triangles,
List<List<VectorXZ>> texCoordLists)
draws triangles with explicitly defined normal vectors. |
void |
finish()
gives the target the chance to perform finish/cleanup operations after all objects have been drawn. |
void |
flushReconstructedFaces()
prevents triangles from before the call to be connected with triangles after this call when faces are reconstructed. |
protected static boolean |
normalAlmostEquals(VectorXYZ n1,
VectorXYZ n2)
|
abstract boolean |
reconstructFaces()
decides whether faces should be reconstructed from triangulations and other primitives. |
Methods inherited from class AbstractTarget |
---|
drawBox, drawColumn, drawTriangleFan, drawTriangleStrip, setConfiguration |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Target |
---|
getRenderableType, render |
Constructor Detail |
---|
public FaceTarget()
Method Detail |
---|
public abstract void drawFace(Material material, List<VectorXYZ> vs, List<VectorXYZ> normals, List<List<VectorXZ>> texCoordLists)
public abstract boolean reconstructFaces()
public void flushReconstructedFaces()
reconstructFaces()
is enabled.
Calling this method at appropriate times can also help to speed up
performance by lowering the number of candidates for merging.
public void drawTriangles(Material material, Collection<? extends TriangleXYZ> triangles, List<List<VectorXZ>> texCoordLists)
Target
texCoordLists
- one texture coordinate list per texture.
Each must have three coordinates per triangle.
Can be null if no texturing information is available.public void drawTrianglesWithNormals(Material material, Collection<? extends TriangleXYZWithNormals> triangles, List<List<VectorXZ>> texCoordLists)
Target
Target.drawTriangles(Material, Collection, List)
public void drawConvexPolygon(Material material, List<VectorXYZ> vs, List<List<VectorXZ>> texCoordLists)
Target
drawConvexPolygon
in interface Target<R extends Renderable>
drawConvexPolygon
in class AbstractTarget<R extends Renderable>
Target.drawTriangleStrip(Material, List, List)
public void beginObject(WorldObject object)
Target
WorldObject
.
This allows targets to group them, if desired.
Otherwise, this can be ignored.
beginObject
in interface Target<R extends Renderable>
beginObject
in class AbstractTarget<R extends Renderable>
public void finish()
Target
finish
in interface Target<R extends Renderable>
finish
in class AbstractTarget<R extends Renderable>
protected static Collection<FaceTarget.Face> combineTrianglesToFaces(Collection<FaceTarget.IsolatedTriangle> isolatedTriangles)
isolatedTriangles
- non-empty collection of trianglesprotected static boolean normalAlmostEquals(VectorXYZ n1, VectorXYZ n2)
protected static FaceTarget.Face createFaceFromTriangle(FaceTarget.IsolatedTriangle t)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |