Module imp3d

Class PolygonMesh

java.lang.Object
de.grogra.imp3d.objects.PolygonsBase
de.grogra.imp3d.objects.PolygonMesh
All Implemented Interfaces:
ContextDependent, Polygons, Polygonization, Serializable
Direct Known Subclasses:
PolygonMeshArray

public class PolygonMesh extends PolygonsBase
This class encapsulates a static PolygonArray. Polygonalization is just making a copy of the stored polygon array to the output array.
Author:
Reinhard Hemmerling
See Also:
  • Field Details

    • indices

      protected int[] indices
    • v

      protected float[] v
    • n

      protected float[] n
    • t

      protected float[] t
    • stamp

      protected int stamp
  • Constructor Details

    • PolygonMesh

      public PolygonMesh()
  • Method Details

    • getVertexData

      public final float[] getVertexData()
    • getNormalData

      public final float[] getNormalData()
    • getTextureData

      public final float[] getTextureData()
    • getIndexData

      public final int[] getIndexData()
    • computeMaxMin

      public float[] computeMaxMin(Matrix4d m)
      Computes max and min values of vertex data. Needed for BoundingBox computation.
      Parameters:
      m - Use can use m to transform all vertices to global coordinates.
      Returns:
      Array{MaxX, MinX, MaxY, MinY, MaxZ, MinZ}
    • computeMaxMin

      public float[] computeMaxMin()
      Computes max and min values of vertex data. Needed for BoundingBox computation.
      Returns:
      Array{MaxX, MinX, MaxY, MinY, MaxZ, MinZ}
    • polygonize

      public void polygonize(ContextDependent source, GraphState gs, PolygonArray out, int flags, float flatness)
      Description copied from interface: Polygonization
      Performs the polygonization of the source into polygons. The field out.userObject is not modified.
      Parameters:
      source - the data source as reported by a previous invocation of Polygonizable.getPolygonizableSource(GraphState) with the same gs
      gs - the current graph state
      out - the polygons are written to out
      flags - combination of bit masks
      flatness - a parameter for the degree of flatness, a typical value is 1
    • setIndexData

      public void setIndexData(IntList indexData)
    • setVertexData

      public void setVertexData(FloatList vertexData)
    • setNormalData

      public void setNormalData(float[] normalData)
    • setTextureData

      public void setTextureData(float[] textureData)
    • incrementStamp

      public void incrementStamp()
    • writeStamp

      public void writeStamp(Cache.Entry cache, GraphState gs)
      Description copied from interface: ContextDependent
      Writes a stamp of the context into cache. Based on this stamp, a cache detects whether the context of this object has changed or not.
      Specified by:
      writeStamp in interface ContextDependent
      Overrides:
      writeStamp in class PolygonsBase
      Parameters:
      cache - a cache entry to write the stamp
      gs - the current graph state
    • getStamp

      public int getStamp()
      Overrides:
      getStamp in class PolygonsBase
    • multiplyMatrixWithTuple3d

      public static void multiplyMatrixWithTuple3d(Matrix4d matrix, Tuple3d point)
      Multiplies matrix with point and writes result into point.
      Parameters:
      matrix -
      point -