📄 node.html
字号:
<p><li><b>Picking.</b> The scope of the pick ray is given as a parameter tothe <code>pick</code> methods in Group. Again, only those objects can bepicked that are in the same scope as the pick ray; the others areignored.</li></p></ul><p>The default scope is -1, implying that all nodes are in the same scope.By default, all objects are therefore visible to all cameras, and are litby all light sources.</p><h3><a name="Instantiation">Instantiation</a></h3><p>Node is an abstract class, and therefore has no public constructor.When a class derived from Node is instantiated, the attributes definedin Node will have the following default values:</p><ul><li>parent node : null</li><li>rendering enable : <i>true</i></li><li>picking enable : <i>true</i></li><li>alpha factor : 1.0</li><li>alignment : none</li><li>scope : -1</li></ul><h3>Implementation guidelines</h3><p>The alignment rotation <b>A</b> is computed relative to the initialcoordinate system A defined by the <b>T</b> component of the nodetransformation alone. All other transformation components of the nodebeing aligned are ignored.</p><p>Conceptually, alignment is composed of two cumulative rotations:the shortest rotation <b>R</b><sub>z</sub> that takes the initial Zaxis to the Z alignment target vector, followed by the rotation<b>R</b><sub>y</sub> about the resulting Z vector that minimizes theangle between the resulting Y axis and the Y alignment target vector.If alignment is set for one axis only, that rotation is performed likethe initial Z rotation.</p><p>Formally, let us denote by <b>t</b><sub>Z</sub> and<b>t</b><sub>Y</sub> the Z and Y alignment target vectors, transformedfrom their respective reference nodes to A; note that axis targetstransform as vectors, and origin targets as points. The axis for thefirst rotation <b>R</b><sub>z</sub> is then the cross product of thelocal Z axis of A and the target vector:</p><blockquote><b>a</b><sub>Z</sub> = (0 0 1)<sup>T</sup> × <b>t</b><sub>Z</sub></blockquote><p>and the rotation angle can be computed via the dot product of thetwo. Rotating by <b>R</b><sub>z</sub> takes us to a new coordinate frameB where <b>t</b><sub>Y</sub> is expressed as:</p><blockquote><b>t</b><sub>Y</sub>' = <b>R</b><sub>Z</sub><sup>-1</sup> × <b>t</b><sub>Y</sub></blockquote><p>The axis for the second rotation <b>R</b><sub>Y</sub> is the localZ axis of B, and the angle is the angle between the local Y axis andthe projection of <b>t</b><sub>Y</sub>' on the XY plane. The finalalignment rotation <b>A</b> is then:</p><blockquote><b>A</b> = <b>R</b><sub>Z</sub> <b>R</b><sub>Y</sub></blockquote><p>There are two cases where a rotation axis is undefined. Firstly, ifeither target vector coincides with the axis that it is a target for,the respective rotation must be substituted with an identity rotation.Secondly, if the target vector and the axis are opposite, the exactrotation path (that is, the resultant direction of the other two axes)is implementation dependent, but must be deterministic. Note that thelatter only matters for unconstrained (single-axis) alignment.</p>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#Node">Binary format</a></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#NONE">NONE</A></B></CODE>
<BR>
Specifies for the <code>setAlignment</code> method that no alignment should be done for the specified axis.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#ORIGIN">ORIGIN</A></B></CODE>
<BR>
Specifies the origin of the reference node as an orientation reference for the <code>setAlignment</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#X_AXIS">X_AXIS</A></B></CODE>
<BR>
Specifies the X axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#Y_AXIS">Y_AXIS</A></B></CODE>
<BR>
Specifies the Y axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#Z_AXIS">Z_AXIS</A></B></CODE>
<BR>
Specifies the Z axis of the reference node as an orientation reference for the <code>setAlignment</code> method.</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></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/microedition/m3g/Node.html#align(javax.microedition.m3g.Node)">align</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A> reference)</CODE>
<BR>
Applies alignments to this Node and its descendants.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getAlphaFactor()">getAlphaFactor</A></B>()</CODE>
<BR>
Retrieves the alpha factor of this Node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../javax/microedition/m3g/Node.html">Node</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getParent()">getParent</A></B>()</CODE>
<BR>
Returns the scene graph parent of this node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getScope()">getScope</A></B>()</CODE>
<BR>
Retrieves the scope of this Node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#getTransformTo(javax.microedition.m3g.Node, javax.microedition.m3g.Transform)">getTransformTo</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A> target, <A HREF="../../../javax/microedition/m3g/Transform.html">Transform</A> transform)</CODE>
<BR>
Gets the composite transformation from this node to the given node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#isPickingEnabled()">isPickingEnabled</A></B>()</CODE>
<BR>
Retrieves the picking enable flag of this Node. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Node.html#isRenderingEnabled()">isRenderingEnabled</A></B>()</CODE>
<BR>
Retrieves the rendering enable flag of this Node. </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/microedition/m3g/Node.html#setAlignment(javax.microedition.m3g.Node, int, javax.microedition.m3g.Node, int)">setAlignment</A></B>(<A HREF="../../../javax/microedition/m3g/Node.html">Node</A> zRef, int zTarget, <A HREF="../../../javax/microedition/m3g/Node.html">Node</A> yRef, int yTarget)</CODE>
<BR>
Sets this node to align with the given other node(s), or disables alignment. </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/microedition/m3g/Node.html#setAlphaFactor(float)">setAlphaFactor</A></B>(float alphaFactor)</CODE>
<BR>
Sets the alpha factor for this Node. </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/microedition/m3g/Node.html#setPickingEnable(boolean)">setPickingEnable</A></B>(boolean enable)</CODE>
<BR>
Sets the picking enable flag of this Node. </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/microedition/m3g/Node.html#setRenderingEnable(boolean)">setRenderingEnable</A></B>(boolean enable)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -