de.grogra.ray.util
Class Ray

java.lang.Object
  extended by de.grogra.ray.util.Ray

public class Ray
extends java.lang.Object

This class represents a light ray.

Author:
Ole Kniemeyer

Field Summary
 boolean ambient
           
 Spectrum3f color
          The ray color.
 Vector3f direction
          The ray direction.
 float directionDensity
          The probability density of direction for this ray.
 float m_importance
           
 Point3f origin
          The ray origin in global coordinates.
 float originDensity
          The probability density of origin for this ray.
 boolean reflected
           
 Spectrum spectrum
          The spectrum of the ray.
 boolean valid
           
 
Constructor Summary
Ray()
           
Ray(Point3d newOrigin, Vector3d newDirection, float probability)
           
Ray(Point3f newOrigin, Vector3f newDirection, float probability)
           
Ray(Ray temp)
           
Ray(Spectrum factory)
           
 
Method Summary
 Line convert2Line()
           
 boolean equals(java.lang.Object obj)
           
 Color3f getColor()
           
 Vector3f getDirection()
           
 float getImportance()
           
 Point3f getOrigin()
           
 int hashCode()
           
 void setImportance(float value)
           
 void setRay(Ray ray)
           
 java.lang.String toString()
           
 void transform(Matrix4d mat, Ray ray)
           
 void transform(Matrix4f mat, Ray ray)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ambient

public boolean ambient

color

public final Spectrum3f color
The ray color. Depending on context, this may represent BRDF-related values for the color components R, G, B, rather than simply an RGB color.


direction

public final Vector3f direction
The ray direction. This direction unit vector is defined as the direction pointing away from a surface position in global coordinates. I.e., for an outgoing ray, it equals its direction, whereas for an incident ray, the direction is its negated direction.


directionDensity

public float directionDensity
The probability density of direction for this ray. This field is set by Shader.generateRandomRays and Light.generateRandomRays. If pω+ is the probability density that has been used for generating the random ray direction (measured with respect to projected solid angle ω+, i.e., dω+ = cos θ dω), then this field is set to pω+(direction). It is not defined for rays emanating from a directional light source. It may be Float.POSITIVE_INFINITY as a result of Shader.generateRandomRays, namely for ideal specular reflection or transmission.


m_importance

public float m_importance

origin

public final Point3f origin
The ray origin in global coordinates. This field is only used in the context of Interior.attenuate(Interior.Input, Color3f) and the methods of Light and its subinterfaces.


originDensity

public float originDensity
The probability density of origin for this ray. This field is set by Light.generateRandomRays. If px is the probability density that has been used for generating the random ray origin, then this field is set to px(origin). It is not defined for rays emanating from a point light source.


reflected

public boolean reflected

spectrum

public final Spectrum spectrum
The spectrum of the ray. Depending on context, this may represent the ray's spectral radiant power or other properties.


valid

public boolean valid
Constructor Detail

Ray

public Ray()

Ray

public Ray(Point3d newOrigin,
           Vector3d newDirection,
           float probability)

Ray

public Ray(Point3f newOrigin,
           Vector3f newDirection,
           float probability)

Ray

public Ray(Ray temp)

Ray

public Ray(Spectrum factory)
Method Detail

convert2Line

public Line convert2Line()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getColor

public Color3f getColor()

getDirection

public Vector3f getDirection()

getImportance

public float getImportance()

getOrigin

public Point3f getOrigin()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setImportance

public void setImportance(float value)

setRay

public void setRay(Ray ray)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

transform

public void transform(Matrix4d mat,
                      Ray ray)

transform

public void transform(Matrix4f mat,
                      Ray ray)