📄 inputdevice.html
字号:
</DL><HR><A NAME="NON_BLOCKING"><!-- --></A><H3>NON_BLOCKING</H3><PRE>static final int <B>NON_BLOCKING</B></PRE><DL><DD>Signifies that the driver for a device is a non-blocking driver and that it should be scheduled for regular reads by Java 3D. A non-blocking driver is defined as a driver that does not cause the calling thread to block while data is being retrieved from the driver. If no data is available from the device, pollAndProcessInput should return without updating the sensor read value.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.InputDevice.NON_BLOCKING">Constant Field Values</A></DL></DL><HR><A NAME="DEMAND_DRIVEN"><!-- --></A><H3>DEMAND_DRIVEN</H3><PRE>static final int <B>DEMAND_DRIVEN</B></PRE><DL><DD>Signifies that the Java 3D implementation should not schedule regular reads on the sensors of this device; the Java 3D implementation will only call pollAndProcessInput when one of the device's sensors' getRead methods is called. A DEMAND_DRIVEN driver must always provide the current value of the sensor on demand whenever pollAndProcessInput is called. This means that DEMAND_DRIVEN drivers are non-blocking by definition.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.InputDevice.DEMAND_DRIVEN">Constant Field Values</A></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="initialize()"><!-- --></A><H3>initialize</H3><PRE>boolean <B>initialize</B>()</PRE><DL><DD>This method initializes the device. A device should be initialized before it is registered with Java 3D via the PhysicalEnvironment.addInputDevice(InputDevice) method call.<P><DD><DL><DT><B>Returns:</B><DD>return true for succesful initialization, false for failure</DL></DD></DL><HR><A NAME="setNominalPositionAndOrientation()"><!-- --></A><H3>setNominalPositionAndOrientation</H3><PRE>void <B>setNominalPositionAndOrientation</B>()</PRE><DL><DD>This method sets the device's current position and orientation as the devices nominal position and orientation (establish its reference frame relative to the "Tracker base" reference frame).<P><DD><DL></DL></DD></DL><HR><A NAME="pollAndProcessInput()"><!-- --></A><H3>pollAndProcessInput</H3><PRE>void <B>pollAndProcessInput</B>()</PRE><DL><DD>This method causes the device's sensor readings to be updated by the device driver. For BLOCKING and NON_BLOCKING drivers, this method is called regularly and the Java 3D implementation can cache the sensor values. For DEMAND_DRIVEN drivers this method is called each time one of the Sensor.getRead methods is called, and is not otherwise called.<P><DD><DL></DL></DD></DL><HR><A NAME="processStreamInput()"><!-- --></A><H3>processStreamInput</H3><PRE>void <B>processStreamInput</B>()</PRE><DL><DD>This method will not be called by the Java 3D implementation and should be implemented as an empty method.<P><DD><DL></DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>void <B>close</B>()</PRE><DL><DD>Code to process the clean up of the device and relinquish associated resources. This method should be called after the device has been unregistered from Java 3D via the PhysicalEnvironment.removeInputDevice(InputDevice) method call.<P><DD><DL></DL></DD></DL><HR><A NAME="getProcessingMode()"><!-- --></A><H3>getProcessingMode</H3><PRE>int <B>getProcessingMode</B>()</PRE><DL><DD>This method retrieves the device's processing mode: one of BLOCKING, NON_BLOCKING, or DEMAND_DRIVEN. The Java 3D implementation calls this method when PhysicalEnvironment.addInputDevice(InputDevice) is called to register the device with Java 3D. If this method returns any value other than BLOCKING, NON_BLOCKING, or DEMAND_DRIVEN, addInputDevice will throw an IllegalArgumentException.<P><DD><DL><DT><B>Returns:</B><DD>Returns the devices processing mode, one of BLOCKING, NON_BLOCKING, or DEMAND_DRIVEN</DL></DD></DL><HR><A NAME="setProcessingMode(int)"><!-- --></A><H3>setProcessingMode</H3><PRE>void <B>setProcessingMode</B>(int mode)</PRE><DL><DD>This method sets the device's processing mode to one of: BLOCKING, NON_BLOCKING, or DEMAND_DRIVEN. Many drivers will be written to run in only one mode. Applications using such drivers should not attempt to set the processing mode. This method should throw an IllegalArgumentException if there is an attempt to set the processing mode to anything other than the aforementioned three values. <p> NOTE: this method should <i>not</i> be called after the input device has been added to a PhysicalEnvironment. The processingMode must remain constant while a device is attached to a PhysicalEnvironment.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>mode</CODE> - One of BLOCKING, NON_BLOCKING, or DEMAND_DRIVEN</DL></DD></DL><HR><A NAME="getSensorCount()"><!-- --></A><H3>getSensorCount</H3><PRE>int <B>getSensorCount</B>()</PRE><DL><DD>This method gets the number of sensors associated with the device.<P><DD><DL><DT><B>Returns:</B><DD>the device's sensor count.</DL></DD></DL><HR><A NAME="getSensor(int)"><!-- --></A><H3>getSensor</H3><PRE><A HREF="../../../javax/media/j3d/Sensor.html" title="class in javax.media.j3d">Sensor</A> <B>getSensor</B>(int sensorIndex)</PRE><DL><DD>Gets the specified Sensor associated with the device. Each InputDevice implementation is responsible for creating and managing its own set of sensors. The sensor indices begin at zero and end at number of sensors minus one. Each sensor should have had Sensor.setDevice(InputDevice) set properly before addInputDevice is called.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>sensorIndex</CODE> - the sensor to retrieve<DT><B>Returns:</B><DD>Returns the specified sensor.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/media/j3d/IndexedTriangleStripArray.html" title="class in javax.media.j3d"><B>PREV CLASS</B></A> <A HREF="../../../javax/media/j3d/Interpolator.html" title="class in javax.media.j3d"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/media/j3d/InputDevice.html" target="_top"><B>FRAMES</B></A> <A HREF="InputDevice.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1">Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../LICENSE-SPEC.html">license terms</a>.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -