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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the form factor map.Converts this patch into a mesh.boolean
ffMapContains
(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.int
Returns the maximum number of edges of a single polygon of the mesh.float
getMaxRadDifference
(SubPatch other) Returns the maximum difference of radiosity color.Returns the normal vector of this patch.void
Gets the normal vector of normalindex
.int
Returns the number of normals of the mesh.int
getPolygon
(int index, int[] indicesOut, int[] normalsOut) Writes the vertex indices of polygonindex
toindicesOut
and the normal indices tonormalsOut
and returns the number of vertices of the polygon.int
Returns the number of polygons of the mesh.Returns the radiosity color.void
Gets the uv coordinates of vertexindex
.void
Gets the spatial vertex coordinates of vertexindex
.int
Returns the number of vertices of the mesh.Vector3d[]
Returns an array of vertices.boolean
isClosed()
Indicates whether this mesh is a closed surface or not.boolean
isPolygonPlanar
(int index) Returnstrue
iff the polygon numberindex
is planar.boolean
Returns true.void
Moves the patch along the given vector.void
rotateX
(double thetaX) Rotates the patch around the x-axis.void
rotateY
(double thetaY) Rotates the patch around the y-axis.void
rotateZ
(double thetaZ) Rotates the patch around the z-axis.void
Sets the vertices for this patch.void
setRadiosity
(float x, float y, float z) Sets the radiosity color.void
setRadiosity
(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:Mesh
Returns the maximum number of edges of a single polygon of the mesh.- Specified by:
getMaxEdgeCount
in interfaceMesh
- Returns:
- maximum number of edges
-
getNormal
Description copied from interface:Mesh
Gets the normal vector of normalindex
. The normal vector is not necessarily normalized. -
getNormalCount
public int getNormalCount()Description copied from interface:Mesh
Returns the number of normals of the mesh.- Specified by:
getNormalCount
in interfaceMesh
- Returns:
- number of normals
-
getPolygon
public int getPolygon(int index, int[] indicesOut, int[] normalsOut) Description copied from interface:Mesh
Writes the vertex indices of polygonindex
toindicesOut
and the normal indices tonormalsOut
and 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:
getPolygon
in 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:Mesh
Returns the number of polygons of the mesh.- Specified by:
getPolygonCount
in interfaceMesh
- Returns:
- number of polygons
-
getUV
Description copied from interface:Mesh
Gets the uv coordinates of vertexindex
. -
getVertex
Description copied from interface:Mesh
Gets the spatial vertex coordinates of vertexindex
. -
getVertexCount
public int getVertexCount()Description copied from interface:Mesh
Returns the number of vertices of the mesh.- Specified by:
getVertexCount
in interfaceMesh
- Returns:
- number of vertices
-
isPolygonPlanar
public boolean isPolygonPlanar(int index) Description copied from interface:Mesh
Returnstrue
iff the polygon numberindex
is planar.- Specified by:
isPolygonPlanar
in interfaceMesh
- Parameters:
index
- polygon number- Returns:
- is polygon planar?
-
isClosed
public boolean isClosed()Description copied from interface:Mesh
Indicates whether this mesh is a closed surface or not. If it is closed, normal vectors have to point to the exterior.
-