Class LightControl

java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.scene.control.LightControl
All Implemented Interfaces:
Savable, Control, JmeCloneable, Cloneable

public class LightControl extends AbstractControl
This Control maintains a reference to a Camera, which will be synched with the position (worldTranslation) of the current spatial.
  • Constructor Details

    • LightControl

      public LightControl()
      Constructor used for Serialization.
    • LightControl

      public LightControl(Light light)
      Parameters:
      light - The light to be synced.
    • LightControl

      public LightControl(Light light, LightControl.ControlDirection controlDir)
      Parameters:
      light - The light to be synced.
      controlDir - SpatialToCamera or CameraToSpatial
  • Method Details

    • getLight

      public Light getLight()
    • setLight

      public void setLight(Light light)
    • getControlDir

      public LightControl.ControlDirection getControlDir()
    • setControlDir

      public void setControlDir(LightControl.ControlDirection controlDir)
    • controlUpdate

      protected void controlUpdate(float tpf)
      Description copied from class: AbstractControl
      To be implemented in subclass.
      Specified by:
      controlUpdate in class AbstractControl
      Parameters:
      tpf - time per frame (in seconds)
    • controlRender

      protected void controlRender(RenderManager rm, ViewPort vp)
      Description copied from class: AbstractControl
      To be implemented in subclass.
      Specified by:
      controlRender in class AbstractControl
      Parameters:
      rm - the RenderManager rendering the controlled Spatial (not null)
      vp - the ViewPort being rendered (not null)
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Description copied from interface: JmeCloneable
      Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner. The object can call cloner.clone(fieldValue) to deep clone any of its fields.

      Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.

      Specified by:
      cloneFields in interface JmeCloneable
      Overrides:
      cloneFields in class AbstractControl
      Parameters:
      cloner - The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
      original - The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class AbstractControl
      Throws:
      IOException
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class AbstractControl
      Throws:
      IOException