java.lang.Object
de.grogra.ray2.radiosity.SubPatch
- All Implemented Interfaces:
Mesh
This class describes a patch containing a triangle.
- Author:
- Ralf Kopsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the form factor map.Converts this patch into a mesh.booleanffMapContains(List<SubPatch> deprecatedPatches) Checks whether, the list of deprecated patches contains this patch.Return the center of this patch.getFFMap()Returns the form factor map.intReturns the maximum number of edges of a single polygon of the mesh.floatgetMaxRadDifference(SubPatch other) Returns the maximum difference of radiosity color.Returns the normal vector of this patch.voidGets the normal vector of normalindex.intReturns the number of normals of the mesh.intgetPolygon(int index, int[] indicesOut, int[] normalsOut) Writes the vertex indices of polygonindextoindicesOutand the normal indices tonormalsOutand returns the number of vertices of the polygon.intReturns the number of polygons of the mesh.Returns the radiosity color.voidGets the uv coordinates of vertexindex.voidGets the spatial vertex coordinates of vertexindex.intReturns the number of vertices of the mesh.Vector3d[]Returns an array of vertices.booleanisClosed()Indicates whether this mesh is a closed surface or not.booleanisPolygonPlanar(int index) Returnstrueiff the polygon numberindexis planar.booleanReturns true.voidMoves the patch along the given vector.voidrotateX(double thetaX) Rotates the patch around the x-axis.voidrotateY(double thetaY) Rotates the patch around the y-axis.voidrotateZ(double thetaZ) Rotates the patch around the z-axis.voidSets the vertices for this patch.voidsetRadiosity(float x, float y, float z) Sets the radiosity color.voidsetRadiosity(Color3f col) Sets the radiosity color.toString()
-
Constructor Details
-
SubPatch
Constructor, creates a new SubPatch.- Parameters:
a- vertice 1b- vertice 2c- vertice 3
-
SubPatch
Copy Constructor- Parameters:
in- the SubPatch to copy.
-
-
Method Details
-
getFFMap
Returns the form factor map.- Returns:
- Returns the form factor map.
-
clearFFMap
public void clearFFMap()Clears the form factor map. -
setRadiosity
Sets the radiosity color.- Parameters:
col- the radiosity color to set.
-
setRadiosity
public void setRadiosity(float x, float y, float z) Sets the radiosity color.- Parameters:
x- the x-value.y- the y-value.z- the z-value.
-
getRadiosity
Returns the radiosity color.- Returns:
- Returns the radiosity color.
-
set
Sets the vertices for this patch.- Parameters:
a- vertice 1b- vertice 2c- vertice 3
-
getCenter
Return the center of this patch.- Returns:
- Return the center of this patch.
-
getNormal
Returns the normal vector of this patch.- Returns:
- Returns the normal vector of this patch.
-
isTriangle
public boolean isTriangle()Returns true.- Returns:
-
getVertices
Returns an array of vertices.- Returns:
- Returns an array of vertices.
-
move
Moves the patch along the given vector.- Parameters:
deltaVert- the move vector.
-
rotateX
public void rotateX(double thetaX) Rotates the patch around the x-axis.- Parameters:
thetaX- the rotation angle.
-
rotateY
public void rotateY(double thetaY) Rotates the patch around the y-axis.- Parameters:
thetaY- the rotation angle.
-
rotateZ
public void rotateZ(double thetaZ) Rotates the patch around the z-axis.- Parameters:
thetaZ- the rotation angle.
-
getMaxRadDifference
Returns the maximum difference of radiosity color.- Parameters:
other- another patch.- Returns:
- Returns the maximum difference of radiosity color.
-
toString
-
createMesh
Converts this patch into a mesh.- Returns:
- Converts this patch into a mesh.
-
ffMapContains
Checks whether, the list of deprecated patches contains this patch.- Parameters:
deprecatedPatches- the list of deprecated patches.- Returns:
-
getMaxEdgeCount
public int getMaxEdgeCount()Description copied from interface:MeshReturns the maximum number of edges of a single polygon of the mesh.- Specified by:
getMaxEdgeCountin interfaceMesh- Returns:
- maximum number of edges
-
getNormal
Description copied from interface:MeshGets the normal vector of normalindex. The normal vector is not necessarily normalized. -
getNormalCount
public int getNormalCount()Description copied from interface:MeshReturns the number of normals of the mesh.- Specified by:
getNormalCountin interfaceMesh- Returns:
- number of normals
-
getPolygon
public int getPolygon(int index, int[] indicesOut, int[] normalsOut) Description copied from interface:MeshWrites the vertex indices of polygonindextoindicesOutand the normal indices tonormalsOutand returns the number of vertices of the polygon. If the mesh is closed (seeMesh.isClosed()), inside and outside are determined by the ordering of the vertices: when seen from the outside, vertices have to be oriented in a counter-clockwise manner. Then also the normal vectors have to point to the outside.- Specified by:
getPolygonin interfaceMesh- Parameters:
index- polygon numberindicesOut- the vertex indices will be placed in herenormalsOut- the normal indices will be placed in here- Returns:
- number of vertex indices of polygon
-
getPolygonCount
public int getPolygonCount()Description copied from interface:MeshReturns the number of polygons of the mesh.- Specified by:
getPolygonCountin interfaceMesh- Returns:
- number of polygons
-
getUV
Description copied from interface:MeshGets the uv coordinates of vertexindex. -
getVertex
Description copied from interface:MeshGets the spatial vertex coordinates of vertexindex. -
getVertexCount
public int getVertexCount()Description copied from interface:MeshReturns the number of vertices of the mesh.- Specified by:
getVertexCountin interfaceMesh- Returns:
- number of vertices
-
isPolygonPlanar
public boolean isPolygonPlanar(int index) Description copied from interface:MeshReturnstrueiff the polygon numberindexis planar.- Specified by:
isPolygonPlanarin interfaceMesh- Parameters:
index- polygon number- Returns:
- is polygon planar?
-
isClosed
public boolean isClosed()Description copied from interface:MeshIndicates whether this mesh is a closed surface or not. If it is closed, normal vectors have to point to the exterior.
-