org.osm2world.core.target.common
Class PrimitiveTarget<R extends Renderable>
Object
AbstractTarget<R>
PrimitiveTarget<R>
- All Implemented Interfaces:
- Target<R>
- Direct Known Subclasses:
- JOGLTarget, PrimitiveBuffer, StatisticsTarget
public abstract class PrimitiveTarget<R extends Renderable>
- extends AbstractTarget<R>
superclass for targets that are based on OpenGL primitives.
These targets will treat different primitives similarly:
They convert them all to a list of vertices
and represent the primitive type using an enum or flags.
Method Summary |
protected abstract void |
drawPrimitive(Primitive.Type type,
Material material,
List<VectorXYZ> vs,
List<VectorXYZ> normals,
List<List<VectorXZ>> texCoordLists)
|
void |
drawTriangleFan(Material material,
List<VectorXYZ> vs,
List<List<VectorXZ>> texCoordLists)
draws a triangle fan. |
void |
drawTriangles(Material material,
Collection<? extends TriangleXYZ> triangles,
List<List<VectorXZ>> texCoordLists)
draws triangles. |
void |
drawTriangleStrip(Material material,
List<VectorXYZ> vs,
List<List<VectorXZ>> texCoordLists)
draws a triangle strip. |
void |
drawTrianglesWithNormals(Material material,
Collection<? extends TriangleXYZWithNormals> triangles,
List<List<VectorXZ>> texCoordLists)
draws triangles with explicitly defined normal vectors. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrimitiveTarget
public PrimitiveTarget()
drawPrimitive
protected abstract void drawPrimitive(Primitive.Type type,
Material material,
List<VectorXYZ> vs,
List<VectorXYZ> normals,
List<List<VectorXZ>> texCoordLists)
- Parameters:
vs
- vertices that form the primitivenormals
- normal vector for each vertex; same size as vstexCoordLists
- texture coordinates for each texture layer,
each list has the same size as vs
drawTriangleStrip
public void drawTriangleStrip(Material material,
List<VectorXYZ> vs,
List<List<VectorXZ>> texCoordLists)
- Description copied from interface:
Target
- draws a triangle strip.
- Specified by:
drawTriangleStrip
in interface Target<R extends Renderable>
- Overrides:
drawTriangleStrip
in class AbstractTarget<R extends Renderable>
vs
- vertices of the triangle striptexCoordLists
- one texture coordinate list per texture.
Each must have the same length as the "vs" parameter.
Can be null if no texturing information is available.
drawTriangleFan
public void drawTriangleFan(Material material,
List<VectorXYZ> vs,
List<List<VectorXZ>> texCoordLists)
- Description copied from interface:
Target
- draws a triangle fan.
- Specified by:
drawTriangleFan
in interface Target<R extends Renderable>
- Overrides:
drawTriangleFan
in class AbstractTarget<R extends Renderable>
- See Also:
Target.drawTriangleStrip(Material, List, List)
drawTriangles
public void drawTriangles(Material material,
Collection<? extends TriangleXYZ> triangles,
List<List<VectorXZ>> texCoordLists)
- Description copied from interface:
Target
- draws triangles.
texCoordLists
- one texture coordinate list per texture.
Each must have three coordinates per triangle.
Can be null if no texturing information is available.
drawTrianglesWithNormals
public void drawTrianglesWithNormals(Material material,
Collection<? extends TriangleXYZWithNormals> triangles,
List<List<VectorXZ>> texCoordLists)
- Description copied from interface:
Target
- draws triangles with explicitly defined normal vectors.
- See Also:
Target.drawTriangles(Material, Collection, List)