Sensor
class represents a sensor device that contains a reference to the SensorData
instance feeding data to the device.
@author Ben L. Titzer
The Sensor object provides an abstract concept of a hardware input device. A Sensor consists of a timestamped sequence of input values and the state of buttons or switches at the time that Java 3D sampled the value. A sensor also contains a hotspot offset specified in the sensor's local coordinate system. If not specified, the hotspot is (0.0, 0.0, 0.0).
Since a typical hardware environment may contain multiple sensing elements, Java 3D maintains an array of sensors. Users can access a sensor directly from their Java code or they can assign a sensor to one of Java 3D's predefined 6DOF entities, such as UserHead.
Using a sensor is as easy as accessing an object. Write your Java code to extract the associated sensor value from the array of sensors. You can then directly apply that value to an element in a scene graph or process the sensor values in whatever way necessary.
Java 3D includes three special six-degrees-of-freedom (6DOF) entities. These include UserHead, DominantHand, and NondominantHand. You can assign or change which sensor drives one of these predefined entities. Java 3D uses the specified sensor to drive the 6DOF entity - most visibly the View.
Java 3D does not provide raw tracker or joystick-generated data in a sensor. At a minimum, Java 3D normalizes the raw data using the registration and calibration parameters either provided by or provided for the end user. It additionally may filter and process the data to remove noise and improve latency. The application programmer can suppress this latter effect on a sensor-by-sensor basis.
@see SensorRead
A Sensor is invoked once during the analysis of a project. The sensor can parse a flat file, connect to a web server... Sensor are generally used to add measure at the lowest level of the resource tree. A sensor can access and save measures on the whole tree of resources.
For example the Cobertura Sensor parses Cobertura report and saves the first-level of measures on resources.
A particular attention should be given to resource exclusion. Sonar already manages exclusions at file level : if you try to save a measure on a resource that is excluded in the settings, then Sonar will not save the measure. When handling a plugin or an external tool, you should make sure that exclusions are passed if you are going to get back consolidated data.
@since 1.10
|
|
|
|
|
|
|
|
|
|
|
|
|
|