Class OGLSpotLight
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseLightNode
org.web3d.vrml.renderer.common.nodes.lighting.BaseSpotLight
org.web3d.vrml.renderer.ogl.nodes.lighting.OGLSpotLight
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLChildNodeType
,VRMLLightNodeType
,VRMLNodeType
,VRMLWorldRootChildNodeType
,OGLLightNodeType
,OGLVRMLNode
public class OGLSpotLight
extends BaseSpotLight
implements OGLLightNodeType, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of a spotlight.
- Version:
- $Revision: 1.11 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.lighting.BaseSpotLight
FIELD_ATTENUATION, FIELD_BEAMWIDTH, FIELD_CUTOFFANGLE, FIELD_DIRECTION, FIELD_LOCATION, FIELD_RADIUS, LAST_SPOTLIGHT_INDEX, vfAttenuation, vfBeamWidth, vfCutOffAngle, vfDirection, vfLocation, vfRadius
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseLightNode
FIELD_AMBIENT_INTENSITY, FIELD_COLOR, FIELD_GLOBAL, FIELD_INTENSITY, FIELD_ON, GLOBAL_VERSION_ERR, LAST_LIGHT_INDEX, vfAmbientIntensity, vfColor, vfGlobal, vfIntensity, vfOn
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new default instance of this class.OGLSpotLight
(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.Light
getLight()
Get the light making up this LightNode.org.j3d.aviatrix3d.SceneGraphObject
Get the Aviatrix3d scene graph object representation of this node.void
setAmbientIntensity
(float intensity) Accessor method to get current value of field ambientIntensity.protected void
setAttenuation
(float[] factor) Set the attenuation factor of the light.protected void
setBeamWidth
(float value) Set the beamWidth of the light.void
setColor
(float[] newColor) Accessor method to get current value of field color.protected void
setCutOffAngle
(float value) Set the cutOffAngle of the light.protected void
setDirection
(float[] dir) Set the direction of the spot light.void
setGlobal
(boolean global) Set the current value of the global field.void
setIntensity
(float intensity) Accessor method to get current value of field Intensity.protected void
setLocation
(float[] loc) Set the location of the point light.void
setOn
(boolean state) Turn the light on or off.protected void
setRadius
(float radius) Set the radius of the light.void
Notification that the construction phase of this node has finished.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.lighting.BaseSpotLight
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, sendRoute, setValue, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseLightNode
copy, getAmbientIntensity, getColor, getGlobal, getIntensity, getOn, getPrimaryType, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.nodes.VRMLLightNodeType
getAmbientIntensity, getColor, getGlobal, getIntensity, getOn
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLSpotLight
public OGLSpotLight()Construct a new default instance of this class. -
OGLSpotLight
Construct a new instance of this node based on the details from the given node. If the node is not a light node, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- Incorrect Node Type
-
-
Method Details
-
getLight
public org.j3d.aviatrix3d.Light getLight()Get the light making up this LightNode.- Specified by:
getLight
in interfaceOGLLightNodeType
- Returns:
- The OGL light instance
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
setAmbientIntensity
Accessor method to get current value of field ambientIntensity.- Specified by:
setAmbientIntensity
in interfaceVRMLLightNodeType
- Overrides:
setAmbientIntensity
in classBaseLightNode
- Parameters:
intensity
- The new value- Throws:
InvalidFieldValueException
- The value was out of the valid range
-
setColor
Accessor method to get current value of field color.- Specified by:
setColor
in interfaceVRMLLightNodeType
- Overrides:
setColor
in classBaseLightNode
- Parameters:
newColor
- The new value- Throws:
InvalidFieldValueException
- The value was out of the valid range
-
setIntensity
Accessor method to get current value of field Intensity.- Specified by:
setIntensity
in interfaceVRMLLightNodeType
- Overrides:
setIntensity
in classBaseLightNode
- Parameters:
intensity
- The new value- Throws:
InvalidFieldValueException
- The value was out of the valid range
-
setOn
public void setOn(boolean state) Turn the light on or off.- Specified by:
setOn
in interfaceVRMLLightNodeType
- Overrides:
setOn
in classBaseLightNode
- Parameters:
state
- The new value
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the Aviatrix3d scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The AV3D representation.
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classAbstractNode
-
setGlobal
Set the current value of the global field.- Specified by:
setGlobal
in interfaceVRMLLightNodeType
- Overrides:
setGlobal
in classBaseLightNode
- Parameters:
global
- true if this should have global effect, false for scoped- Throws:
InvalidFieldException
- Called on a node that belongs to VRML or X3D 3.0.
-
setDirection
protected void setDirection(float[] dir) Set the direction of the spot light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setDirection
in classBaseSpotLight
- Parameters:
dir
- The new direction vector to use
-
setLocation
protected void setLocation(float[] loc) Set the location of the point light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setLocation
in classBaseSpotLight
- Parameters:
loc
- The new location to use
-
setRadius
Set the radius of the light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setRadius
in classBaseSpotLight
- Parameters:
radius
- The new radius to use- Throws:
InvalidFieldValueException
- Radius value was negative
-
setAttenuation
Set the attenuation factor of the light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setAttenuation
in classBaseSpotLight
- Parameters:
factor
- The new attenuation factor to use- Throws:
InvalidFieldValueException
- Radius value was negative
-
setBeamWidth
Set the beamWidth of the light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setBeamWidth
in classBaseSpotLight
- Parameters:
value
- The new width to use in radians- Throws:
InvalidFieldValueException
- Width was not 0 to PI/2
-
setCutOffAngle
Set the cutOffAngle of the light. Should be overridden by derived classes for implementation-specific additions.- Overrides:
setCutOffAngle
in classBaseSpotLight
- Parameters:
value
- The new width to use in radians- Throws:
InvalidFieldValueException
- Width was not 0 to PI/2
-