simbad.sim
Class LightSensor

java.lang.Object
  extended by simbad.sim.BaseObject
      extended by simbad.sim.Device
          extended by simbad.sim.SensorDevice
              extended by simbad.sim.Eye
                  extended by simbad.sim.LightSensor

public class LightSensor
extends Eye

This class models a single light sensor. The sensor outputs a float proportionnal to received light.
Implementation Note:
We use a small camera to implement the light sensor. The camera must look back at the sensor body so as to measured the light received.


Nested Class Summary
 class LightSensor.LigthSensorJPanel
           
 
Nested classes/interfaces inherited from class simbad.sim.Eye
Eye.EyeJPanel
 
Field Summary
(package private)  float luminance
           
 
Fields inherited from class simbad.sim.Eye
imageHeight, imageWidth, tempRGBABuffer, visionImage
 
Fields inherited from class simbad.sim.BaseObject
black, branchGroup, canBeTraversed, compilable, detachedFromSceneGraph, group, localBounds, material, rotation, rotationGroup, translation, translationGroup, white, world
 
Constructor Summary
LightSensor()
           
 
Method Summary
(package private)  void create3D(float radius)
           
 javax.swing.JPanel createInspectorPanel()
          Creates the panel associated to the device.
 float getAverageLuminance()
          Returns the measured luminance.
protected  void update()
          Called by simulator
 
Methods inherited from class simbad.sim.Eye
copyVisionImage, copyVisionImage, createCompatibleImage, createCompatibleSensorMatrix, createViewPlatform, getImageHeight, getImageWidth
 
Methods inherited from class simbad.sim.Device
getName, getOwner, getUpdatePerSecond, reset, setName, setOwner, setUpdateOnEachFrame, setUpdatePerSecond, update
 
Methods inherited from class simbad.sim.BaseObject
addChild, addChild, attach, compile, create3D, detach, getBounds, getCanBeTraversed, getGroup, getNode, getRotationTransform, getRotationTransformGroup, getTranslation, getTranslationTransform, getTranslationTransform, resetTransforms, rotateY, setBounds, setCanBeTraversed, setColor, setWorld, translateTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

luminance

float luminance
Constructor Detail

LightSensor

public LightSensor()
Method Detail

getAverageLuminance

public float getAverageLuminance()
Returns the measured luminance.

Returns:
0.0 means no light , 1.0 f maximum enlightment

create3D

void create3D(float radius)
Overrides:
create3D in class Eye

update

protected void update()
Called by simulator

Overrides:
update in class Eye

createInspectorPanel

public javax.swing.JPanel createInspectorPanel()
Description copied from class: Device
Creates the panel associated to the device. This panel can be inserted in the inspector window for monitoring.

Overrides:
createInspectorPanel in class Eye
Returns:
the JPanel. null if no panel can be associated