Class VertexCollector

java.lang.Object
de.grogra.mesh.renderer.VertexCollector
All Implemented Interfaces:
RenderState

public class VertexCollector extends Object implements RenderState
  • Field Details

    • pool

      public final Pool pool
  • Constructor Details

  • Method Details

    • getVertices

      public FloatList getVertices()
    • clearVertices

      public void clearVertices()
    • getRenderGraphState

      public GraphState getRenderGraphState()
      Specified by:
      getRenderGraphState in interface RenderState
    • getPool

      public Pool getPool()
      Specified by:
      getPool in interface RenderState
    • getCurrentShader

      public Shader getCurrentShader()
      Specified by:
      getCurrentShader in interface RenderState
    • getFontMetrics

      public FontMetrics getFontMetrics(Font font)
      Specified by:
      getFontMetrics in interface RenderState
    • getCurrentHighlight

      public int getCurrentHighlight()
      Specified by:
      getCurrentHighlight in interface RenderState
    • estimateScaleAt

      public float estimateScaleAt(Tuple3f point)
      Specified by:
      estimateScaleAt in interface RenderState
    • drawPoint

      public void drawPoint(Tuple3f origin, int size, Tuple3f color, int highlight, Matrix4d t)
      Points are currently displayed as a cube. Would it make more sense to have a smaller (less faces) shape? like a pyramid?
      Specified by:
      drawPoint in interface RenderState
    • drawBox

      public void drawBox(float halfWidth, float halfLength, float height, Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawBox in interface RenderState
    • drawPolygons

      public void drawPolygons(Polygonizable polygons, Object obj, boolean asNode, Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawPolygons in interface RenderState
    • drawLine

      public void drawLine(Tuple3f start, Tuple3f end, Tuple3f color, int highlight, Matrix4d m)
      Specified by:
      drawLine in interface RenderState
    • drawPointCloud

      public void drawPointCloud(float[] locations, float pointSize, Tuple3f color, int highlight, Matrix4d t)
      Description copied from interface: RenderState
      Draw a set of points. The array locations contains a sequence of points given as triples of floats for x, y and z position of each point. If the same reference for the array location is passed in the implementation might assume that the contents of the array are the same as well. This is necessary for GLDisplay, for instance, to ensure a performant implementation. The class PointCloud ensures that this is the case.
      Specified by:
      drawPointCloud in interface RenderState
      Parameters:
      locations - array containing a sequence (x,y,z) of points
      pointSize - size of the point on screen
      color - color of the point
      t - transformation of the point cloud
    • drawParallelogram

      public void drawParallelogram(float axis, Vector3f secondAxis, float scaleU, float scaleV, Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawParallelogram in interface RenderState
    • drawPlane

      public void drawPlane(Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawPlane in interface RenderState
    • drawSphere

      public void drawSphere(float radius, Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawSphere in interface RenderState
    • drawTextBlock

      public void drawTextBlock(String caption, Font font, float depth, Shader s, int highlight, boolean asWireframe, Matrix4d t)
      Specified by:
      drawTextBlock in interface RenderState
    • drawSupershape

      public void drawSupershape(float a, float b, float m1, float n11, float n12, float n13, float m2, float n21, float n22, float n23, Shader s, int highlight, boolean asWireframe, Matrix4d t)
      Description copied from interface: RenderState
      Draw a supershape around the origin (0/0/0). An implementation of Johan Gielis's Superformula which was published in the American Journal of Botany 90(3): 333–338. 2003. INVITED SPECIAL PAPER A GENERIC GEOMETRIC TRANSFORMATION THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES
      Specified by:
      drawSupershape in interface RenderState
      Parameters:
      a - , b length of curves
      t - transformation of the point cloud
    • drawLamella

      public void drawLamella(float halfWidth, float halfLength, float height, float a, float b, Shader s, int highlight, boolean asWireframe, Matrix4d t)
      Specified by:
      drawLamella in interface RenderState
      a - amplitude
      b - frequency
    • drawFrustum

      public void drawFrustum(float height, float baseRadius, float topRadius, boolean baseClosed, boolean topClosed, float scaleV, Shader s, int highlight, boolean asWireframe, Matrix4d m)
      Specified by:
      drawFrustum in interface RenderState
    • drawPrismRectangular

      public void drawPrismRectangular(float y, float xPos, float xNeg, float zPos, float zNeg, int highlight, boolean asWireframe, Matrix4d t)
      Specified by:
      drawPrismRectangular in interface RenderState
    • getWindowPos

      public boolean getWindowPos(Tuple3f location, Tuple2f out)
      Description copied from interface: RenderState
      Computes the window coordinates in pixels of a location in the current object coordinates.
      Specified by:
      getWindowPos in interface RenderState
      Parameters:
      location - a location in local object coordinates
      out - the computed window coordinates are placed in here
      Returns:
      true iff the window coordinates are valid (i.e., the location is in the clipping region)
    • drawRectangle

      public void drawRectangle(int x, int y, int w, int h, Tuple3f color)
      Specified by:
      drawRectangle in interface RenderState
    • fillRectangle

      public void fillRectangle(int x, int y, int w, int h, Tuple3f color)
      Specified by:
      fillRectangle in interface RenderState
    • drawString

      public void drawString(int x, int y, String text, Font font, Tuple3f color)
      Specified by:
      drawString in interface RenderState
    • drawFrustumIrregular

      public void drawFrustumIrregular(float height, int sectorCount, float[] baseRadii, float[] topRadii, boolean baseClosed, boolean topclosed, float scaleV, Shader s, int highlight, boolean asWireframe, Matrix4d t)
      Specified by:
      drawFrustumIrregular in interface RenderState
    • drawSphereSegmentSolid

      public void drawSphereSegmentSolid(float radius, float theta1, float theta2, float phi, Shader s, int highlight, boolean asWireframe, Matrix4d t)
      Specified by:
      drawSphereSegmentSolid in interface RenderState