org.osm2world.core.target.primitivebuffer
Class PrimitiveBuffer

Object
  extended by AbstractTarget
      extended by PrimitiveTarget
          extended by PrimitiveBuffer
All Implemented Interfaces:
Target

public class PrimitiveBuffer
extends PrimitiveTarget

Storage for low-level rendering information (vertex and primitive data) that can be displayed using graphics APIs, e.g. OpenGL. Higher-level information, such as object coherence, OSM attributes or representations, isn't present in an OGLBuffer.


Field Summary
 Map<Material,List<Primitive>> primitiveMap
           
 ArrayList<VectorXYZ> vertexCollection
           
 
Constructor Summary
PrimitiveBuffer()
           
 
Method Summary
 void addWorldObjects(MapData mapData, Camera camera)
           
protected  void drawPrimitive(Primitive.Type type, Material material, List<? extends VectorXYZ> vertices, VectorXYZ[] normals)
           
 void optimize()
          optimizes the primitives, for example by merging them into larger primitives.
 
Methods inherited from class PrimitiveTarget
drawPolygon, drawPolygon, drawTriangleFan, drawTriangles, drawTriangleStrip, drawTriangleStrip, drawTrianglesWithNormals
 
Methods inherited from class AbstractTarget
drawBox, drawColumn
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertexCollection

public ArrayList<VectorXYZ> vertexCollection

primitiveMap

public Map<Material,List<Primitive>> primitiveMap
Constructor Detail

PrimitiveBuffer

public PrimitiveBuffer()
Method Detail

drawPrimitive

protected void drawPrimitive(Primitive.Type type,
                             Material material,
                             List<? extends VectorXYZ> vertices,
                             VectorXYZ[] normals)
Specified by:
drawPrimitive in class PrimitiveTarget
vertices - vertices that form the primitive
normals - normal vector for each vertex; same size as vs

optimize

public void optimize()
optimizes the primitives, for example by merging them into larger primitives.


addWorldObjects

public void addWorldObjects(MapData mapData,
                            Camera camera)