public class LightSample
extends java.lang.Object
Constructor and Description |
---|
LightSample()
Creates a new light sample object (invalid by default).
|
Modifier and Type | Method and Description |
---|---|
float |
dot(Vector3 v)
Compute a dot product between the current shadow ray direction and the
specified vector.
|
Color |
getDiffuseRadiance()
Get diffuse radiance.
|
Ray |
getShadowRay()
Get the sample's shadow ray.
|
Color |
getSpecularRadiance()
Get specular radiance.
|
void |
setRadiance(Color d,
Color s)
Set the diffuse and specular radiance emitted by the current light
source.
|
void |
setShadowRay(Ray shadowRay)
Set the current shadow ray.
|
void |
traceShadow(ShadingState state)
Trace the shadow ray, attenuating the sample's color by the opacity of
intersected objects.
|
public LightSample()
public void setShadowRay(Ray shadowRay)
shadowRay
- shadow ray from the point being shaded towards the lightpublic final void traceShadow(ShadingState state)
state
- shading state representing the point to be shadedpublic Ray getShadowRay()
public Color getDiffuseRadiance()
public Color getSpecularRadiance()
public void setRadiance(Color d, Color s)
d
- diffuse radiances
- specular radiancepublic float dot(Vector3 v)
v
- direction vector