java.lang.Object
de.grogra.ray2.photonmap.PhotonMap
This class provides a photon map.
The photon map uses a kd-tree data structure for fast access.
- Author:
- Ralf Kopsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of photon map entries.voidinsertPhoton(Color3f col, Point3d pos, Vector3f dir) Inserts a new Photon into this map.voidsumPhotons(Point3d point, Vector3f normal, Tuple3d color) Calculates the color for the given point.floattraceRay(Intersection desc, Tuple3d color) This is only a debug function.
-
Constructor Details
-
PhotonMap
public PhotonMap(double photonArea) Creates a new Photon Map.- Parameters:
photonArea- the scanning area.
-
-
Method Details
-
insertPhoton
Inserts a new Photon into this map.- Parameters:
col- The Photon color.pos- The Photon position.dir- The Photon impact direction.
-
sumPhotons
Calculates the color for the given point.- Parameters:
point- the impact point.normal- the impact normal vector.color- output - the calculated color
-
traceRay
This is only a debug function. It direct visualise the photon map.- Parameters:
desc- the intersection descriptioncolor- output - the calculated color- Returns:
- transparent value
-
getEntryCount
public int getEntryCount()Returns the number of photon map entries.- Returns:
- Returns the number of photon map entries.
-