com.hedgehog.geo.threed.world
Class SpotLighting3D

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.geo.threed.world.AbstractLighting3D
          extended by com.hedgehog.geo.threed.world.SpotLighting3D
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class SpotLighting3D
extends AbstractLighting3D

Title: SpotLighting3D - extends AbstractLighting3D specifically for spot lighting

Description: Extends AbstractLighting3D specifically for spot lighting.

Based on the X3D SpotLight node.

Copyright: Copyright (c) Hedgehog Software.

Company: Hedgehog Software.

Since:
1.1
Version:
1.1

Field Summary
protected  Vector3D mAttenuation
          Attenuation.
protected  double mBeamWidth
          Beam width.
protected  double mCutOffAngle
          Cut off angle.
protected  Vector3D mDirection
          Direction vector.
protected  Vector3D mLocation
          Location.
protected  double mRadius
          Radius.
 
Fields inherited from class com.hedgehog.geo.threed.world.AbstractLighting3D
DIRECTIONAL_LIGHTING, mAmbientIntensity, mColour, mIntensity, mOn, POINT_LIGHTING, SPOT_LIGHTING
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
SpotLighting3D()
          Default constructor.
SpotLighting3D(SpotLighting3D object)
          Copy constructor.
SpotLighting3D(Vector3D attenuation, double beamWidth, double cutOffAngle, Vector3D direction, Vector3D location, double radius)
          Constructor.
 
Method Summary
 Vector3D getAttenuation()
          Returns the attenuation.
 double getBeamWidth()
          Returns the beam width.
 double getCutOffAngle()
          Returns the cut off angle.
 Vector3D getDirection()
          Returns the direction vector.
 Vector3D getLocation()
          Returns the location.
 double getRadius()
          Returns the radius.
 int lightingType()
          Returns the type of lighting; ie SPOT_LIGHTING.
 void setAttenuation(Vector3D attenuation)
          Sets the attenuation.
 void setBeamWidth(double beamWidth)
          Sets the beam width.
 void setCutOffAngle(double cutOffAngle)
          Sets the cut off angle.
 void setDirection(Vector3D direction)
          Sets the direction vector.
 void setLocation(Vector3D location)
          Sets the location.
 void setRadius(double radius)
          Sets the radius.
 java.lang.String toString()
          Returns a String representation of a SpotLighting3D object.
 X3DNode toX3DNode()
          Returns the equivalent X3D node of this object; ie SpotLightNode.
 
Methods inherited from class com.hedgehog.geo.threed.world.AbstractLighting3D
getAmbientIntensity, getColour, getIntensity, getOn, setAmbientIntensity, setColour, setIntensity, setOn
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mAttenuation

protected Vector3D mAttenuation
Attenuation. Default is (1,0,0).


mBeamWidth

protected double mBeamWidth
Beam width. Default is PI/2.


mCutOffAngle

protected double mCutOffAngle
Cut off angle. Default is PI/4.


mDirection

protected Vector3D mDirection
Direction vector. Default is (0,0,-1).


mLocation

protected Vector3D mLocation
Location. Default is (0,0,0).


mRadius

protected double mRadius
Radius. Default is 100.0.

Constructor Detail

SpotLighting3D

public SpotLighting3D()
Default constructor. Sets the attenuation to (1,0,0), beam width to PI/2, cut off angle to PI/4, direction to (0,0,-1), location to (0,0,0) and the radius to 100.0.


SpotLighting3D

public SpotLighting3D(Vector3D attenuation,
                      double beamWidth,
                      double cutOffAngle,
                      Vector3D direction,
                      Vector3D location,
                      double radius)
Constructor.

Parameters:
attenuation - Attaneuation.
beamWidth - Beam width.
cutOffAngle - Cut off angle.
direction - Direction.
location - location.
radius - Radius.

SpotLighting3D

public SpotLighting3D(SpotLighting3D object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getAttenuation

public Vector3D getAttenuation()
Returns the attenuation.

Returns:
The attenuation.

getBeamWidth

public double getBeamWidth()
Returns the beam width.

Returns:
The beam width.

getCutOffAngle

public double getCutOffAngle()
Returns the cut off angle.

Returns:
The cut off angle.

getDirection

public Vector3D getDirection()
Returns the direction vector.

Returns:
The direction vector.

getLocation

public Vector3D getLocation()
Returns the location.

Returns:
The location.

getRadius

public double getRadius()
Returns the radius.

Returns:
The radius.

setAttenuation

public void setAttenuation(Vector3D attenuation)
Sets the attenuation.

Parameters:
attenuation - New attenuation.

setBeamWidth

public void setBeamWidth(double beamWidth)
Sets the beam width.

Parameters:
beamWidth - New beam width.

setCutOffAngle

public void setCutOffAngle(double cutOffAngle)
Sets the cut off angle.

Parameters:
cutOffAngle - New cut off angle.

setDirection

public void setDirection(Vector3D direction)
Sets the direction vector.

Parameters:
direction - New direction vector.

setLocation

public void setLocation(Vector3D location)
Sets the location.

Parameters:
location - New location.

setRadius

public void setRadius(double radius)
Sets the radius.

Parameters:
radius - New radius.

toString

public java.lang.String toString()
Returns a String representation of a SpotLighting3D object.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of a SpotLighting3D object.

lightingType

public int lightingType()
Returns the type of lighting; ie SPOT_LIGHTING.

Specified by:
lightingType in class AbstractLighting3D
Returns:
The type of lighting.

toX3DNode

public X3DNode toX3DNode()
Returns the equivalent X3D node of this object; ie SpotLightNode.

Specified by:
toX3DNode in class AbstractLighting3D
Returns:
The equivalent X3D node of this object.