org.osm2world.core.target.common
public abstract class FaceTarget<R extends Renderable> extends AbstractTarget<R>
Modifier and Type | Class and Description |
---|---|
protected static class |
FaceTarget.Face
mutable representation of a face
|
protected static class |
FaceTarget.IsolatedTriangle |
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
Constructor and Description |
---|
FaceTarget() |
Modifier and Type | Method and Description |
---|---|
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.
|
drawBox, drawColumn, drawExtrudedShape, drawShape, drawTriangleFan, drawTriangleStrip, setConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRenderableType, render
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
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 FaceTarget.Face createFaceFromTriangle(FaceTarget.IsolatedTriangle t)