java.lang.Object
de.grogra.imp3d.objects.PolygonsBase
de.grogra.imp3d.objects.PolygonMesh
- All Implemented Interfaces:
ContextDependent,Polygons,Polygonization,Serializable
- Direct Known Subclasses:
PolygonMeshArray
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 Summary
FieldsModifier and TypeFieldDescriptionprotected int[]protected float[]protected intprotected float[]protected float[]Fields inherited from interface de.grogra.imp3d.Polygonization
COMPUTE_NORMALS, COMPUTE_UV -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]Computes max and min values of vertex data.float[]Computes max and min values of vertex data.final int[]final float[]intgetStamp()final float[]final float[]voidstatic voidmultiplyMatrixWithTuple3d(Matrix4d matrix, Tuple3d point) Multiplies matrix with point and writes result into point.voidpolygonize(ContextDependent source, GraphState gs, PolygonArray out, int flags, float flatness) Performs the polygonization of the source into polygons.voidsetIndexData(IntList indexData) voidsetNormalData(float[] normalData) voidsetTextureData(float[] textureData) voidsetVertexData(FloatList vertexData) voidwriteStamp(Cache.Entry cache, GraphState gs) Writes a stamp of the context intocache.Methods inherited from class de.grogra.imp3d.objects.PolygonsBase
dependsOnContext
-
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
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:PolygonizationPerforms the polygonization of the source into polygons. The fieldout.userObjectis not modified.- Parameters:
source- the data source as reported by a previous invocation ofPolygonizable.getPolygonizableSource(GraphState)with the samegsgs- the current graph stateout- the polygons are written tooutflags- combination of bit masksflatness- a parameter for the degree of flatness, a typical value is 1
-
setIndexData
-
setVertexData
-
setNormalData
public void setNormalData(float[] normalData) -
setTextureData
public void setTextureData(float[] textureData) -
incrementStamp
public void incrementStamp() -
writeStamp
Description copied from interface:ContextDependentWrites a stamp of the context intocache. Based on this stamp, a cache detects whether the context of this object has changed or not.- Specified by:
writeStampin interfaceContextDependent- Overrides:
writeStampin classPolygonsBase- Parameters:
cache- a cache entry to write the stampgs- the current graph state
-
getStamp
public int getStamp()- Overrides:
getStampin classPolygonsBase
-
multiplyMatrixWithTuple3d
Multiplies matrix with point and writes result into point.- Parameters:
matrix-point-
-