Interface SpotLight

All Superinterfaces:
X3DChildNode, X3DLightNode, X3DNode
All Known Implementing Classes:
SpotLight

public interface SpotLight extends X3DLightNode
Linear attenuation may occur at level 2, full support at level 3.

Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the org.web3d.x3d.jsail classes. X3D node tooltip: [X3DLightNode] SpotLight is a light source that illuminates geometry within a conical beam. Lighting illuminates all geometry except lines and points. By default, light scope only illuminates peer geometry and children nodes within the scene graph hierarchy. Lights have no visible shape themselves and lighting effects continue through any intermediate geometry. Hint: the bound NavigationInfo controls whether headlight is enabled on/off. *


Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named ambientIntensity.
    float[]
    Provide array of 3-tuple float results within allowed range of [0,infinity) from inputOutput SFVec3f field named attenuation.
    float
    Provide float value within allowed range of (0,1.570796] from inputOutput SFFloat field named beamWidth.
    float[]
    Provide array of 3-tuple float results using RGB values [0..1] using RGB values [0..1] from inputOutput SFColor field named color.
    float
    Provide float value unit axis, angle (in radians) within allowed range of (0,1.570796] from inputOutput SFFloat field named cutOffAngle.
    float[]
    Provide array of 3-tuple float results from inputOutput SFVec3f field named direction.
    boolean
    Provide boolean value from inputOutput SFBool field named global.
    float
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named intensity.
    float[]
    Provide array of 3-tuple float results from inputOutput SFVec3f field named location.
    Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    boolean
    Provide boolean value from inputOutput SFBool field named on.
    float
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named radius.
    float
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named shadowIntensity.
    boolean
    Provide boolean value from inputOutput SFBool field named shadows.
    setAmbientIntensity(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named ambientIntensity.
    setAttenuation(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named attenuation.
    setBeamWidth(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named beamWidth.
    setColor(float[] newValue)
    Accessor method to assign 3-tuple float array using RGB values [0..1] to inputOutput SFColor field named color.
    setCutOffAngle(float newValue)
    Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named cutOffAngle.
    setDirection(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named direction.
    setGlobal(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named global.
    setIntensity(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named intensity.
    setLocation(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named location.
    Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
    setOn(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named on.
    setRadius(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named radius.
    setShadowIntensity(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named shadowIntensity.
    setShadows(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named shadows.
  • Method Details

    • getAmbientIntensity

      float getAmbientIntensity()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named ambientIntensity.

      Tooltip: [0,1] Brightness of ambient (nondirectional background) emission from the light. *
      Specified by:
      getAmbientIntensity in interface X3DLightNode
      Returns:
      value of ambientIntensity field
    • setAmbientIntensity

      SpotLight setAmbientIntensity(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named ambientIntensity.

      Tooltip: [0,1] Brightness of ambient (nondirectional background) emission from the light. *
      Specified by:
      setAmbientIntensity in interface X3DLightNode
      Parameters:
      newValue - is new value for the ambientIntensity field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getAttenuation

      float[] getAttenuation()
      Provide array of 3-tuple float results within allowed range of [0,infinity) from inputOutput SFVec3f field named attenuation.

      Tooltip: Constant, linear-distance and squared-distance dropoff factors as radial distance increases from the source. Hint: attenuation = 1/max(attenuation[0] + attenuation[1] ⨯ r + attenuation[2] ⨯ r2 , 1). *
      Returns:
      value of attenuation field
    • setAttenuation

      SpotLight setAttenuation(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named attenuation.

      Tooltip: Constant, linear-distance and squared-distance dropoff factors as radial distance increases from the source. Hint: attenuation = 1/max(attenuation[0] + attenuation[1] ⨯ r + attenuation[2] ⨯ r2 , 1). *
      Parameters:
      newValue - is new value for the attenuation field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getBeamWidth

      float getBeamWidth()
      Provide float value within allowed range of (0,1.570796] from inputOutput SFFloat field named beamWidth.

      Tooltip: [0,1.570796] Inner conical solid angle (in radians) where light source has uniform full intensity. Hint: beamWidth is inner angle of full intensity, cutOffAngle is outer angle of zero intensity. Therefore set beamWidth &lt;= cutOffAngle. Warning: if beamWidth &gt; cutOffAngle, then beamWidth is reset to equal cutOffAngle. Hint: radian units for angular measure <a href="https://en.wikipedia.org/wiki/Radian" target="_blank">https://en.wikipedia.org/wiki/Radian</a> *
      Returns:
      value of beamWidth field
    • setBeamWidth

      SpotLight setBeamWidth(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named beamWidth.

      Tooltip: [0,1.570796] Inner conical solid angle (in radians) where light source has uniform full intensity. Hint: beamWidth is inner angle of full intensity, cutOffAngle is outer angle of zero intensity. Therefore set beamWidth &lt;= cutOffAngle. Warning: if beamWidth &gt; cutOffAngle, then beamWidth is reset to equal cutOffAngle. Hint: radian units for angular measure <a href="https://en.wikipedia.org/wiki/Radian" target="_blank">https://en.wikipedia.org/wiki/Radian</a> *
      Parameters:
      newValue - is new value for the beamWidth field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getColor

      float[] getColor()
      Provide array of 3-tuple float results using RGB values [0..1] using RGB values [0..1] from inputOutput SFColor field named color.

      Tooltip: [0,1] color of light, applied to colors of objects. Hint: X3D Scene Authoring Hints, Color <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Color" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Color</a> *
      Specified by:
      getColor in interface X3DLightNode
      Returns:
      value of color field
    • setColor

      SpotLight setColor(float[] newValue)
      Accessor method to assign 3-tuple float array using RGB values [0..1] to inputOutput SFColor field named color.

      Tooltip: [0,1] color of light, applied to colors of objects. Hint: X3D Scene Authoring Hints, Color <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Color" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Color</a> *
      Specified by:
      setColor in interface X3DLightNode
      Parameters:
      newValue - is new value for the color field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getCutOffAngle

      float getCutOffAngle()
      Provide float value unit axis, angle (in radians) within allowed range of (0,1.570796] from inputOutput SFFloat field named cutOffAngle.

      Tooltip: [0,1.570796] Outer conical solid angle (in radians) where light source intensity becomes zero. Hint: beamWidth is inner angle of full intensity, cutOffAngle is outer angle of zero intensity. Therefore set beamWidth &lt;= cutOffAngle. Warning: if beamWidth &gt; cutOffAngle, then beamWidth is reset to equal cutOffAngle. Hint: radian units for angular measure <a href="https://en.wikipedia.org/wiki/Radian" target="_blank">https://en.wikipedia.org/wiki/Radian</a> *
      Returns:
      value of cutOffAngle field
    • setCutOffAngle

      SpotLight setCutOffAngle(float newValue)
      Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named cutOffAngle.

      Tooltip: [0,1.570796] Outer conical solid angle (in radians) where light source intensity becomes zero. Hint: beamWidth is inner angle of full intensity, cutOffAngle is outer angle of zero intensity. Therefore set beamWidth &lt;= cutOffAngle. Warning: if beamWidth &gt; cutOffAngle, then beamWidth is reset to equal cutOffAngle. Hint: radian units for angular measure <a href="https://en.wikipedia.org/wiki/Radian" target="_blank">https://en.wikipedia.org/wiki/Radian</a> *
      Parameters:
      newValue - is new value for the cutOffAngle field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDirection

      float[] getDirection()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named direction.

      Tooltip: Orientation vector of light relative to local coordinate system. *
      Returns:
      value of direction field
    • setDirection

      SpotLight setDirection(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named direction.

      Tooltip: Orientation vector of light relative to local coordinate system. *
      Parameters:
      newValue - is new value for the direction field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getGlobal

      boolean getGlobal()
      Provide boolean value from inputOutput SFBool field named global.

      Tooltip: Global lights illuminate all objects within their volume of lighting influence. Scoped lights only illuminate objects within the same transformation hierarchy. Warning: DirectionalLight default global=false to limit scope and avoid inadvertently illuminating every object in a large scene. PointLight and SpotLight default global=true since their effects are each limited by maximum radius value. *
      Returns:
      value of global field
    • setGlobal

      SpotLight setGlobal(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named global.

      Tooltip: Global lights illuminate all objects within their volume of lighting influence. Scoped lights only illuminate objects within the same transformation hierarchy. Warning: DirectionalLight default global=false to limit scope and avoid inadvertently illuminating every object in a large scene. PointLight and SpotLight default global=true since their effects are each limited by maximum radius value. *
      Parameters:
      newValue - is new value for the global field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getIntensity

      float getIntensity()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named intensity.

      Tooltip: [0,+infinity] Brightness of direct emission from the light. *
      Specified by:
      getIntensity in interface X3DLightNode
      Returns:
      value of intensity field
    • setIntensity

      SpotLight setIntensity(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named intensity.

      Tooltip: [0,+infinity] Brightness of direct emission from the light. *
      Specified by:
      setIntensity in interface X3DLightNode
      Parameters:
      newValue - is new value for the intensity field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getLocation

      float[] getLocation()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named location.

      Tooltip: Position of light relative to local coordinate system. *
      Returns:
      value of location field
    • setLocation

      SpotLight setLocation(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named location.

      Tooltip: Position of light relative to local coordinate system. *
      Parameters:
      newValue - is new value for the location field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getMetadata

      X3DMetadataObject getMetadata()
      Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.

      Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node. Hint: X3D Architecture 7.2.4 Metadata <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#Metadata" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#Metadata</a> *
      Specified by:
      getMetadata in interface X3DChildNode
      Specified by:
      getMetadata in interface X3DLightNode
      Specified by:
      getMetadata in interface X3DNode
      Returns:
      value of metadata field
      See Also:
    • setMetadata

      SpotLight setMetadata(X3DMetadataObject newValue)
      Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.

      Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node. Hint: X3D Architecture 7.2.4 Metadata <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#Metadata" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#Metadata</a> *
      Specified by:
      setMetadata in interface X3DChildNode
      Specified by:
      setMetadata in interface X3DLightNode
      Specified by:
      setMetadata in interface X3DNode
      Parameters:
      newValue - is new value for the metadata field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      See Also:
    • getOn

      boolean getOn()
      Provide boolean value from inputOutput SFBool field named on.

      Tooltip: Enables/disables this light source. *
      Specified by:
      getOn in interface X3DLightNode
      Returns:
      value of on field
    • setOn

      SpotLight setOn(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named on.

      Tooltip: Enables/disables this light source. *
      Specified by:
      setOn in interface X3DLightNode
      Parameters:
      newValue - is new value for the on field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getRadius

      float getRadius()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named radius.

      Tooltip: Maximum effective distance of light relative to local light position, affected by ancestor scaling. *
      Returns:
      value of radius field
    • setRadius

      SpotLight setRadius(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named radius.

      Tooltip: Maximum effective distance of light relative to local light position, affected by ancestor scaling. *
      Parameters:
      newValue - is new value for the radius field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getShadowIntensity

      float getShadowIntensity()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named shadowIntensity.

      Tooltip: [0,1] shadowIntensity field defines how much light is obscured by shapes that cast shadows, ranging from 0 (light not obscured, no visible shadows) to 1 (light completely obscured, full-intensity shadows). *
      Specified by:
      getShadowIntensity in interface X3DLightNode
      Returns:
      value of shadowIntensity field
    • setShadowIntensity

      SpotLight setShadowIntensity(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named shadowIntensity.

      Tooltip: [0,1] shadowIntensity field defines how much light is obscured by shapes that cast shadows, ranging from 0 (light not obscured, no visible shadows) to 1 (light completely obscured, full-intensity shadows). *
      Specified by:
      setShadowIntensity in interface X3DLightNode
      Parameters:
      newValue - is new value for the shadowIntensity field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getShadows

      boolean getShadows()
      Provide boolean value from inputOutput SFBool field named shadows.

      Tooltip: shadows field indicates whether or not this light casts a shadow behind illuminated X3DShapeNode geometry. *
      Specified by:
      getShadows in interface X3DLightNode
      Returns:
      value of shadows field
    • setShadows

      SpotLight setShadows(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named shadows.

      Tooltip: shadows field indicates whether or not this light casts a shadow behind illuminated X3DShapeNode geometry. *
      Specified by:
      setShadows in interface X3DLightNode
      Parameters:
      newValue - is new value for the shadows field.
      Returns:
      SpotLight - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).