Jazz3D API


com.sygem.jazz3d3
Class Lightspot

java.lang.Object
  |
  +--com.sygem.jazz3d3.Light
        |
        +--com.sygem.jazz3d3.Lightspot

public class Lightspot
extends Light

The most advanced light type. This represents a light which has a physical position in space, and shines in a given direction. The light intensity falls off with distance, and there is a specified 'light-cone', just like a real spotlight. This is the slowest of the light sources.

Version:
3.0a
Author:
SyGem Software
See Also:
Light, Lightpoint

Constructor Summary
Lightspot(double x, double y, double z)
          Default constructor.
 
Method Summary
 void pointAt(double xp, double yp, double zp)
          Point the light source at a point.
 void rotate(double xa, double ya, double za)
          Rotate the light around it's center point.
 void rotate(double xa, double ya, double za, double px, double py, double pz)
          Rotate the light around a given point.
 void setAngle(int ang)
          Set the angle of the light-cone.
 void setFalloff(int fall)
          Set the distance from the light at which the intensity reaches zero.
 void setIntensity(double i)
          Sets the intensity of the light.
 void translate(double xd, double yd, double zd)
          Moves the light source.
 
Methods inherited from class com.sygem.jazz3d3.Light
setColour
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lightspot

public Lightspot(double x,
                 double y,
                 double z)
Default constructor. The parameters represent the position of the light. Note that to start with, the light points at position (0,0,1).
Parameters:
x - The x component of the light position.
y - The y component of the light position.
z - The z component of the light position.
Method Detail

setIntensity

public final void setIntensity(double i)
Sets the intensity of the light.
Overrides:
setIntensity in class Light
Parameters:
intensity - A value from 0 to 1.

translate

public final void translate(double xd,
                            double yd,
                            double zd)
Moves the light source.
Overrides:
translate in class Light
Parameters:
xd - The distance to move the light along the x-axis.
yd - The distance to move the light along the y-axis.
zd - The distance to move the light along the z-axis.

rotate

public final void rotate(double xa,
                         double ya,
                         double za)
Rotate the light around it's center point. Note that this has no effect for spot light sources, because rotating the light doesn't move the point-at vector.
Overrides:
rotate in class Light
Parameters:
xa - The number of degrees to rotate around the x-axis.
ya - The number of degrees to rotate around the y-axis.
za - The number of degrees to rotate around the z-axis.

rotate

public final void rotate(double xa,
                         double ya,
                         double za,
                         double px,
                         double py,
                         double pz)
Rotate the light around a given point. This does actually have an effect for spot light sources - it moves the location of the light around.
Overrides:
rotate in class Light
Parameters:
xa - The number of degrees to rotate around the x-axis.
ya - The number of degrees to rotate around the y-axis.
za - The number of degrees to rotate around the z-axis.
px - The x component of the point to rotate around.
py - The y component of the point to rotate around.
pz - The z component of the point to rotate around.

setFalloff

public final void setFalloff(int fall)
Set the distance from the light at which the intensity reaches zero.
Parameters:
fall - The distance from the light where the intensity reaches zero.

setAngle

public final void setAngle(int ang)
Set the angle of the light-cone.
Parameters:
ang - The angle of the light-cone.

pointAt

public final void pointAt(double xp,
                          double yp,
                          double zp)
Point the light source at a point.
Overrides:
pointAt in class Light
Parameters:
xp - The x coordinate of the point to point at.
yp - The y coordinate of the point to point at.
zp - The z coordinate of the point to point at.

©2001 SyGem Software