Java Doc for Sensor.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.j3d.Sensor

Sensor
public class Sensor (Code)
The Sensor Class encapsulates an object that provides real-time data. Examples include six-degree-of-freedom tracking, a joystick, or a data file being read back during a program. A sensor must be used in conjuction with an implementation of the InputDevice interface.

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 Also:   SensorRead



Field Summary
final public static  intDEFAULT_SENSOR_READ_COUNT
     Default SensorRead object count (30); the number of SensorRead objects constructed if no count is specified.
final public static  intHAND_PREDICTOR
    
final public static  intHEAD_PREDICTOR
    
 intMaxSensorReadIndex
    
final public static  intNO_PREDICTOR
     Use no prediction policy; this is the default.
final public static  intPREDICT_NEXT_FRAME_TIME
    
final public static  intPREDICT_NONE
     Set predictor type to do no prediction; this is the default.
final static  intSENSOR_READ_COUNT_BUFFER
     SENSOR_READ_COUNT_BUFFER is the number of extra sensor reading values to store at the end of the circular list.
 intcurrentIndex
    
 booleandemand_driven
    
 InputDevicedevice
    
 Point3dhotspot
    
 intlastIndex
    
 Matrix3dlocal_svd
    
static  intnum_reads_so_far
    
 Matrix3dorig_rot
    
 Matrix3dorig_rot_transpose
    
 SensorReadreadings
    
 intsensorButtonCount
    
 intsensorReadCount
    
 Matrix3dtemp_rot
    

Constructor Summary
public  Sensor(InputDevice device)
     Constructs a Sensor object for the specified input device using default parameters.
public  Sensor(InputDevice device, int sensorReadCount)
     Constructs a Sensor object for the specified input device using the specified number of SensorRead objects.
public  Sensor(InputDevice device, int sensorReadCount, int sensorButtonCount)
     Constructs a Sensor object for the specified input device using the specified number of SensorRead objects and number of buttons.
public  Sensor(InputDevice device, Point3d hotspot)
     Constructs a Sensor object for the specified input device using the specified hotspot.
public  Sensor(InputDevice device, int sensorReadCount, Point3d hotspot)
     Constructs a Sensor object for the specified input device using the specified number of SensorRead objects and hotspot.
public  Sensor(InputDevice device, int sensorReadCount, int sensorButtonCount, Point3d hotspot)
     Constructs a Sensor object for the specified input device using the specified number of SensorRead objects, number of buttons, and hotspot.

Method Summary
public  SensorReadgetCurrentSensorRead()
     Gets the current sensor read.
public  InputDevicegetDevice()
     Retrieves the sensor's associated input device.
public  voidgetHotspot(Point3d hotspot)
     Get the sensor's hotspot in this sensor's coordinate system.
public  intgetPredictionPolicy()
     Returns the prediction policy used by this sensor.
public  intgetPredictor()
     Returns the type of predictor used by this sensor.
public  voidgetRead(Transform3D read)
     Retrieves the last sensor reading and copies that value into the specified argument.
public  voidgetRead(Transform3D read, long deltaT)
     Retrieves the last sensor reading and copies that value into the specified argument.
public  intgetSensorButtonCount()
     Returns the number of buttons associated with this sensor.
public  intgetSensorReadCount()
     Returns the number of SensorRead objects associated with this sensor.
public  voidlastButtons(int[] values)
     Places the most recent sensor reading value for each button into the array parameter; will throw an ArrayIndexOutOfBoundsException if values.length is less than the number of buttons.
public  voidlastButtons(int k, int[] values)
     Places the kth-most recent sensor reading value for each button into the array parameter; where k=0 is the most recent sensor reading, k=1 is the next most recent sensor reading, etc.; will throw an ArrayIndexOutOfBoundsException if values.length is less than the number of buttons.
public  voidlastRead(Transform3D read)
     Extracts the most recent sensor reading and copies that value into the specified argument.
public  voidlastRead(Transform3D read, int kth)
     Extracts the kth-most recent sensor reading and copies that value into the specified argument; where 0 is the most recent sensor reading, 1 is the next most recent sensor reading, etc.
public  longlastTime()
     Returns the time associated with the most recent sensor reading.
public  longlastTime(int k)
     Returns the time associated with the kth-most recent sensor reading; where 0 is the most recent sensor reading, 1 is the next most recent sensor reading, etc.
 intpreviousIndex(int k)
    
public  voidsetDevice(InputDevice device)
     Set the sensor's associated input device.
public  voidsetHotspot(Point3d hotspot)
     Set the sensor's hotspot in this sensor's coordinate system.
public  voidsetNextSensorRead(long time, Transform3D transform, int[] values)
     Sets the next sensor read to the specified values; once these values are set via this method they become the current values returned by methods such as lastRead(), lastTime(), and lastButtons(); note that if there are no buttons associated with this sensor, values can just be an empty array.
public  voidsetNextSensorRead(SensorRead read)
     Sets the next sensor read to the specified values; once these values are set via this method they become the current values returned by methods such as lastRead(), lastTime(), and lastButtons().
public  voidsetPredictionPolicy(int policy)
     Sets the prediction policy use by this sensor.
public  voidsetPredictor(int predictor)
     Sets the type of predictor to use with this sensor.
public  voidsetSensorReadCount(int count)
     Set the number of sensor read objects per Sensor.

Field Detail
DEFAULT_SENSOR_READ_COUNT
final public static int DEFAULT_SENSOR_READ_COUNT(Code)
Default SensorRead object count (30); the number of SensorRead objects constructed if no count is specified.



HAND_PREDICTOR
final public static int HAND_PREDICTOR(Code)



HEAD_PREDICTOR
final public static int HEAD_PREDICTOR(Code)



MaxSensorReadIndex
int MaxSensorReadIndex(Code)



NO_PREDICTOR
final public static int NO_PREDICTOR(Code)
Use no prediction policy; this is the default.



PREDICT_NEXT_FRAME_TIME
final public static int PREDICT_NEXT_FRAME_TIME(Code)



PREDICT_NONE
final public static int PREDICT_NONE(Code)
Set predictor type to do no prediction; this is the default.



SENSOR_READ_COUNT_BUFFER
final static int SENSOR_READ_COUNT_BUFFER(Code)
SENSOR_READ_COUNT_BUFFER is the number of extra sensor reading values to store at the end of the circular list. It helps provide MT-safeness. This is necessary if someone asks for the last k sensor values and k is close to sensor read count. This helps avoid some synchronization statements in getRead and setNextSensorRead.



currentIndex
int currentIndex(Code)



demand_driven
boolean demand_driven(Code)



device
InputDevice device(Code)



hotspot
Point3d hotspot(Code)



lastIndex
int lastIndex(Code)



local_svd
Matrix3d local_svd(Code)



num_reads_so_far
static int num_reads_so_far(Code)



orig_rot
Matrix3d orig_rot(Code)



orig_rot_transpose
Matrix3d orig_rot_transpose(Code)



readings
SensorRead readings(Code)



sensorButtonCount
int sensorButtonCount(Code)



sensorReadCount
int sensorReadCount(Code)



temp_rot
Matrix3d temp_rot(Code)




Constructor Detail
Sensor
public Sensor(InputDevice device)(Code)
Constructs a Sensor object for the specified input device using default parameters. The default values are as follows:
    sensor read count : 30
    sensor button count : 0
    hot spot : (0,0,0)
    predictor : PREDICT_NONE — this attribute is unused
    prediction policy : NO_PREDICTOR — this attribute is unused

Parameters:
  device - the Sensor's associated device.



Sensor
public Sensor(InputDevice device, int sensorReadCount)(Code)
Constructs a Sensor object for the specified input device using the specified number of SensorRead objects. Default values are used for all other parameters.
Parameters:
  device - the Sensor's associated device
Parameters:
  sensorReadCount - the number of SensorReads to associate withthis sensor



Sensor
public Sensor(InputDevice device, int sensorReadCount, int sensorButtonCount)(Code)
Constructs a Sensor object for the specified input device using the specified number of SensorRead objects and number of buttons. Default values are used for all other parameters.
Parameters:
  device - the Sensor's associated device
Parameters:
  sensorReadCount - the number of SensorReads to associate withthis sensor
Parameters:
  sensorButtonCount - the number of buttons associated with eachsensor read



Sensor
public Sensor(InputDevice device, Point3d hotspot)(Code)
Constructs a Sensor object for the specified input device using the specified hotspot. Default values are used for all other parameters.
Parameters:
  device - the Sensor's associated device
Parameters:
  hotspot - the Sensor's hotspot defined in its local coordinatesystem



Sensor
public Sensor(InputDevice device, int sensorReadCount, Point3d hotspot)(Code)
Constructs a Sensor object for the specified input device using the specified number of SensorRead objects and hotspot. Default values are used for all other parameters.
Parameters:
  device - the Sensor's associated device
Parameters:
  sensorReadCount - the number of SensorReads to associate withthis sensor
Parameters:
  hotspot - the Sensor's hotspot defined in its local coordinatesystem



Sensor
public Sensor(InputDevice device, int sensorReadCount, int sensorButtonCount, Point3d hotspot)(Code)
Constructs a Sensor object for the specified input device using the specified number of SensorRead objects, number of buttons, and hotspot. Default values are used for all other parameters.
Parameters:
  device - the Sensor's associated device
Parameters:
  sensorReadCount - the number of SensorReads to associate withthis sensor
Parameters:
  sensorButtonCount - the number of buttons associated with eachsensor read
Parameters:
  hotspot - the Sensor's hotspot defined in its local coordinatesystem




Method Detail
getCurrentSensorRead
public SensorRead getCurrentSensorRead()(Code)
Gets the current sensor read. the current sensor read object



getDevice
public InputDevice getDevice()(Code)
Retrieves the sensor's associated input device. the sensor's device



getHotspot
public void getHotspot(Point3d hotspot)(Code)
Get the sensor's hotspot in this sensor's coordinate system.
Parameters:
  hotspot - the variable to receive the sensor's hotspot



getPredictionPolicy
public int getPredictionPolicy()(Code)
Returns the prediction policy used by this sensor. the prediction policy.



getPredictor
public int getPredictor()(Code)
Returns the type of predictor used by this sensor. the predictor type.



getRead
public void getRead(Transform3D read)(Code)
Retrieves the last sensor reading and copies that value into the specified argument.
Parameters:
  read - the matrix that will receive the sensor reading



getRead
public void getRead(Transform3D read, long deltaT)(Code)
Retrieves the last sensor reading and copies that value into the specified argument.
Parameters:
  read - the matrix that will receive the sensor reading
Parameters:
  deltaT - this parameter is ignored



getSensorButtonCount
public int getSensorButtonCount()(Code)
Returns the number of buttons associated with this sensor. the number of buttons associated with this sensor.



getSensorReadCount
public int getSensorReadCount()(Code)
Returns the number of SensorRead objects associated with this sensor. the number of SensorReadObjects associated with this sensor



lastButtons
public void lastButtons(int[] values)(Code)
Places the most recent sensor reading value for each button into the array parameter; will throw an ArrayIndexOutOfBoundsException if values.length is less than the number of buttons.
Parameters:
  values - the array into which the button values will beplaced



lastButtons
public void lastButtons(int k, int[] values)(Code)
Places the kth-most recent sensor reading value for each button into the array parameter; where k=0 is the most recent sensor reading, k=1 is the next most recent sensor reading, etc.; will throw an ArrayIndexOutOfBoundsException if values.length is less than the number of buttons.
Parameters:
  k - the time associated with the most recent sensor reading
Parameters:
  values - the array into which the button values will beplaced.



lastRead
public void lastRead(Transform3D read)(Code)
Extracts the most recent sensor reading and copies that value into the specified argument.
Parameters:
  read - the matrix that will receive the most recent sensor reading



lastRead
public void lastRead(Transform3D read, int kth)(Code)
Extracts the kth-most recent sensor reading and copies that value into the specified argument; where 0 is the most recent sensor reading, 1 is the next most recent sensor reading, etc.
Parameters:
  read - the matrix that will receive the most recent sensor reading
Parameters:
  kth - the kth previous sensor reading



lastTime
public long lastTime()(Code)
Returns the time associated with the most recent sensor reading. the time associated with the most recent sensor reading.



lastTime
public long lastTime(int k)(Code)
Returns the time associated with the kth-most recent sensor reading; where 0 is the most recent sensor reading, 1 is the next most recent sensor reading, etc. the time associated with the kth-most recent sensor reading.



previousIndex
int previousIndex(int k)(Code)



setDevice
public void setDevice(InputDevice device)(Code)
Set the sensor's associated input device.
Parameters:
  device - the sensor's new device



setHotspot
public void setHotspot(Point3d hotspot)(Code)
Set the sensor's hotspot in this sensor's coordinate system.
Parameters:
  hotspot - the sensor's new hotspot



setNextSensorRead
public void setNextSensorRead(long time, Transform3D transform, int[] values)(Code)
Sets the next sensor read to the specified values; once these values are set via this method they become the current values returned by methods such as lastRead(), lastTime(), and lastButtons(); note that if there are no buttons associated with this sensor, values can just be an empty array.
Parameters:
  time - the next SensorRead's associated time
Parameters:
  transform - the next SensorRead's transformation
Parameters:
  values - the next SensorRead's buttons' states



setNextSensorRead
public void setNextSensorRead(SensorRead read)(Code)
Sets the next sensor read to the specified values; once these values are set via this method they become the current values returned by methods such as lastRead(), lastTime(), and lastButtons().
Parameters:
  read - the next SensorRead's values



setPredictionPolicy
public void setPredictionPolicy(int policy)(Code)
Sets the prediction policy use by this sensor. Since prediction is not implemented (and never has been), this attribute has no effect.
Parameters:
  policy - prediction policy one of NO_PREDICTOR, HEAD_PREDICTOR,or HAND_PREDICTOR
exception:
  IllegalArgumentException - if an invalid prediction policyis specified.



setPredictor
public void setPredictor(int predictor)(Code)
Sets the type of predictor to use with this sensor. Since prediction is not implemented (and never has been), this attribute has no effect.
Parameters:
  predictor - predictor type one of PREDICT_NONE orPREDICT_NEXT_FRAME_TIME
exception:
  IllegalArgumentException - if an invalid predictor typeis specified.



setSensorReadCount
public void setSensorReadCount(int count)(Code)
Set the number of sensor read objects per Sensor. This is a calibration parameter that should normally be set in this object's constructor. Calling this method resets all of this sensor's values that are already in the buffer. It is illegal to change this value after the device has been added to the scheduler.
Parameters:
  count - the new sensor read count



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.