📄 sensor.html
字号:
<BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#lastRead(javax.media.j3d.Transform3D)">lastRead</A></B>(<A HREF="../../../javax/media/j3d/Transform3D.html">Transform3D</A> read)</CODE><BR> Extracts the most recent sensor reading and copies that value into the specified argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#lastRead(javax.media.j3d.Transform3D, int)">lastRead</A></B>(<A HREF="../../../javax/media/j3d/Transform3D.html">Transform3D</A> read, int kth)</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#lastTime()">lastTime</A></B>()</CODE><BR> Returns the time associated with the most recent sensor reading.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#lastTime(int)">lastTime</A></B>(int k)</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setDevice(javax.media.j3d.InputDevice)">setDevice</A></B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device)</CODE><BR> Set the sensor's associated input device.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setHotspot(javax.vecmath.Point3d)">setHotspot</A></B>(<A HREF="../../../javax/vecmath/Point3d.html">Point3d</A> hotspot)</CODE><BR> Set the sensor's hotspot in this sensor's coordinate system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setNextSensorRead(long, javax.media.j3d.Transform3D, int[])">setNextSensorRead</A></B>(long time, <A HREF="../../../javax/media/j3d/Transform3D.html">Transform3D</A> transform, int[] values)</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setNextSensorRead(javax.media.j3d.SensorRead)">setNextSensorRead</A></B>(<A HREF="../../../javax/media/j3d/SensorRead.html">SensorRead</A> read)</CODE><BR> 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().</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setPredictionPolicy(int)">setPredictionPolicy</A></B>(int policy)</CODE><BR> This function sets the prediction policy use by this sensor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setPredictor(int)">setPredictor</A></B>(int predictor)</CODE><BR> This function sets the type of predictor to use with this sensor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/media/j3d/Sensor.html#setSensorReadCount(int)">setSensorReadCount</A></B>(int count)</CODE><BR> Set the number of sensor read objects per Sensor.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="PREDICT_NONE"><!-- --></A><H3>PREDICT_NONE</H3><PRE>public static final int <B>PREDICT_NONE</B></PRE><DL><DD>Set predictor type to do no prediction; this is the default.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.PREDICT_NONE">Constant Field Values</A></DL></DL><HR><A NAME="PREDICT_NEXT_FRAME_TIME"><!-- --></A><H3>PREDICT_NEXT_FRAME_TIME</H3><PRE>public static final int <B>PREDICT_NEXT_FRAME_TIME</B></PRE><DL><DD>Set predictor type to generate the SensorRead to correspond with the next frame time.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.PREDICT_NEXT_FRAME_TIME">Constant Field Values</A></DL></DL><HR><A NAME="NO_PREDICTOR"><!-- --></A><H3>NO_PREDICTOR</H3><PRE>public static final int <B>NO_PREDICTOR</B></PRE><DL><DD>Use no prediction policy; this is the default.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.NO_PREDICTOR">Constant Field Values</A></DL></DL><HR><A NAME="HEAD_PREDICTOR"><!-- --></A><H3>HEAD_PREDICTOR</H3><PRE>public static final int <B>HEAD_PREDICTOR</B></PRE><DL><DD>Set the predictor policy to assume the sensor is predicting head position/orientation.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.HEAD_PREDICTOR">Constant Field Values</A></DL></DL><HR><A NAME="HAND_PREDICTOR"><!-- --></A><H3>HAND_PREDICTOR</H3><PRE>public static final int <B>HAND_PREDICTOR</B></PRE><DL><DD>Set the predictor policy to assume the sensor is predicting hand position/orientation.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.HAND_PREDICTOR">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_SENSOR_READ_COUNT"><!-- --></A><H3>DEFAULT_SENSOR_READ_COUNT</H3><PRE>public static final int <B>DEFAULT_SENSOR_READ_COUNT</B></PRE><DL><DD>Default SensorRead object count (30); the number of SensorRead objects constructed if no count is specified.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Sensor.DEFAULT_SENSOR_READ_COUNT">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Sensor(javax.media.j3d.InputDevice)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device)</PRE><DL><DD>Constructs a Sensor object for the specified input device using default parameters. The default values are as follows: <ul> sensor read count : 30<br> sensor button count : 0<br> hot spot : (0,0,0)<br> predictor : PREDICT_NONE<br> prediction policy : NO_PREDICTOR<br> </ul><P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device.</DL><HR><A NAME="Sensor(javax.media.j3d.InputDevice, int)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device, int sensorReadCount)</PRE><DL><DD>Constructs a Sensor object for the specified input device using the specified number of SensorRead objects. Default values are used for all other parameters.<P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device<DD><CODE>sensorReadCount</CODE> - the number of SensorReads to associate with this sensor</DL><HR><A NAME="Sensor(javax.media.j3d.InputDevice, int, int)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device, int sensorReadCount, int sensorButtonCount)</PRE><DL><DD>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.<P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device<DD><CODE>sensorReadCount</CODE> - the number of SensorReads to associate with this sensor<DD><CODE>sensorButtonCount</CODE> - the number of buttons associated with each sensor read</DL><HR><A NAME="Sensor(javax.media.j3d.InputDevice, javax.vecmath.Point3d)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device, <A HREF="../../../javax/vecmath/Point3d.html">Point3d</A> hotspot)</PRE><DL><DD>Constructs a Sensor object for the specified input device using the specified hotspot. Default values are used for all other parameters.<P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device<DD><CODE>hotspot</CODE> - the Sensor's hotspot defined in its local coordinate system</DL><HR><A NAME="Sensor(javax.media.j3d.InputDevice, int, javax.vecmath.Point3d)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device, int sensorReadCount, <A HREF="../../../javax/vecmath/Point3d.html">Point3d</A> hotspot)</PRE><DL><DD>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.<P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device<DD><CODE>sensorReadCount</CODE> - the number of SensorReads to associate with this sensor<DD><CODE>hotspot</CODE> - the Sensor's hotspot defined in its local coordinate system</DL><HR><A NAME="Sensor(javax.media.j3d.InputDevice, int, int, javax.vecmath.Point3d)"><!-- --></A><H3>Sensor</H3><PRE>public <B>Sensor</B>(<A HREF="../../../javax/media/j3d/InputDevice.html">InputDevice</A> device, int sensorReadCount, int sensorButtonCount, <A HREF="../../../javax/vecmath/Point3d.html">Point3d</A> hotspot)</PRE><DL><DD>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.<P><DT><B>Parameters:</B><DD><CODE>device</CODE> - the Sensor's associated device<DD><CODE>sensorReadCount</CODE> - the number of SensorReads to associate with this sensor<DD><CODE>sensorButtonCount</CODE> - the number of buttons associated with each sensor read<DD><CODE>hotspot</CODE> - the Sensor's hotspot defined in its local coordinate system</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setPredictor(int)"><!-- --></A><H3>setPredictor</H3><PRE>public void <B>setPredictor</B>(int predictor)</PRE><DL><DD>This function sets the type of predictor to use with this sensor.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>predictor</CODE> - predictor type one of PREDICT_NONE or PREDICT_NEXT_FRAME_TIME<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if an invalid predictor type is specified.</DL></DD></DL><HR><A NAME="getPredictor()"><!-- --></A><H3>getPredictor</H3><PRE>public int <B>getPredictor</B>()</PRE><DL><DD>This function returns the type of predictor used by this sensor.<P><DD><DL><DT><B>Returns:</B><DD>returns the predictor type. One of PREDICT_NONE or PREDICT_NEXT_FRAME_TIME.</DL></DD></DL><HR><A NAME="setPredictionPolicy(int)"><!-- --></A><H3>setPredictionPolicy</H3><PRE>public void <B>setPredictionPolicy</B>(int policy)</PRE><DL><DD>This function sets the prediction policy use by this sensor.<P><DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -