java.lang.Object
javax.vecmath.Tuple3d
de.grogra.ray.physics.Spectrum3d
de.grogra.ray.physics.Collector3d
de.grogra.ray.physics.Collector3dDirectDiffuse
- All Implemented Interfaces:
Collector,Spectrum,DoubleToDouble,Serializable,Cloneable
A
Collector3d that separates incoming rays into direct (first-order,
depth == 0) and diffuse (higher-order, depth > 0)
contributions.
The combined statistics of all rays are maintained by the parent
Collector3d; getDirect() and getDiffuse() give
access to the per-category sub-collectors.
- Author:
- MH at YNL 2026 (based on Collector3dList by adge-k)
- See Also:
-
Field Summary
Fields inherited from class de.grogra.ray.physics.Collector3d
asCollector, rayCount, squareSumDirectionX, squareSumDirectionY, squareSumDirectionZ, squareSumSpectrumX, squareSumSpectrumY, squareSumSpectrumZ, sumDirectionX, sumDirectionY, sumDirectionZ, sumSpectrumX, sumSpectrumY, sumSpectrumZ -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty instance in spectrum mode.Collector3dDirectDiffuse(double x, double y, double z) Creates an instance initialised with the given RGB spectrum values.Collector3dDirectDiffuse(Spectrum spectrum) Creates an instance initialised from the given spectrum. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the newSpectrum to the spectrum of this Collector-instance and update the statistics.voidaddToStatistic(Tuple3d rayOrigin, Spectrum3d spectrum, double scaleFactor, boolean isPrimary) Add the Vector of the origin of a certain ray, which hits the object for this corresponding Collector-instance.clone()Creates a copy of the Spectrum or a deep-copy of this instance.Returns a clone of the diffuse (higher-order) sub-collector.Returns a clone of the direct (first-order) sub-collector.Returns a new instance of this class.voidscaleAll(double factor) Scales the spectral power (x/y/z) AND all accumulated statistics byfactor.voidsetZero()Sets all values the instance to zero.Methods inherited from class de.grogra.ray.physics.Collector3d
add, addToStatistic, getCollectedValues, getDirectionArithmeticMean, getDirectionArithmeticMean, getDirectionArithmeticMean, getDirectionVariance, getDirectionVariance, getDirectionVariance, getRayCount, getSpectrumArithmeticMean, getSpectrumArithmeticMean, getSpectrumVariance, getSpectrumVariance, getSumDirection, getSumSpectrum, isCollector, normalize, normalize, setAsCollectorMethods inherited from class de.grogra.ray.physics.Spectrum3d
clampMinZero, div, div, div, dot, evaluateDouble, get, getMax, integrate, mul, mul, mul, set, setIdentity, sub, sumMethods inherited from class javax.vecmath.Tuple3d
absolute, absolute, add, add, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, epsilonEquals, equals, equals, get, get, get, hashCode, interpolate, interpolate, interpolate, interpolate, max, min, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString
-
Constructor Details
-
Collector3dDirectDiffuse
public Collector3dDirectDiffuse()Creates an empty instance in spectrum mode. -
Collector3dDirectDiffuse
public Collector3dDirectDiffuse(double x, double y, double z) Creates an instance initialised with the given RGB spectrum values.- Parameters:
x- red componenty- green componentz- blue component
-
Collector3dDirectDiffuse
Creates an instance initialised from the given spectrum.- Parameters:
spectrum- initial spectrum to accumulate
-
-
Method Details
-
addToStatistic
public void addToStatistic(Tuple3d rayOrigin, Spectrum3d spectrum, double scaleFactor, boolean isPrimary) Description copied from class:Collector3dAdd the Vector of the origin of a certain ray, which hits the object for this corresponding Collector-instance. Notice: The direction and the weight of the direction doesn't depends on the absorbed power but on the intensity of the incoming ray.- Overrides:
addToStatisticin classCollector3d- Parameters:
rayOrigin- Where the light comes from.
-
scaleAll
public void scaleAll(double factor) Description copied from class:Collector3dScales the spectral power (x/y/z) AND all accumulated statistics byfactor. Must be used instead ofTuple3d.scale(double)whenever the statistics should remain consistent with the scaled spectral values. Linear sums scale byfactor; square sums scale byfactor * factor.- Overrides:
scaleAllin classCollector3d
-
add
Description copied from class:Collector3dAdd the newSpectrum to the spectrum of this Collector-instance and update the statistics.- Specified by:
addin interfaceSpectrum- Overrides:
addin classCollector3d- Parameters:
collector- the spectrum to add
-
getDirect
Returns a clone of the direct (first-order) sub-collector. -
getDiffuse
Returns a clone of the diffuse (higher-order) sub-collector. -
setZero
public void setZero()Description copied from class:Collector3dSets all values the instance to zero. Useful when the instance is still used as container for information/ results of thecomputation.invalid reference
LightModel- Specified by:
setZeroin interfaceSpectrum- Overrides:
setZeroin classCollector3d
-
newInstance
Description copied from class:Collector3dReturns a new instance of this class.- Specified by:
newInstancein interfaceCollector- Specified by:
newInstancein interfaceSpectrum- Overrides:
newInstancein classCollector3d- Returns:
- new instance of same class
-
clone
Description copied from class:Collector3dCreates a copy of the Spectrum or a deep-copy of this instance.
-