📄 viewinfo.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_06) on Wed Dec 13 16:20:13 PST 2006 --><TITLE>ViewInfo (Java 3D 1.5.0)</TITLE><META NAME="keywords" CONTENT="com.sun.j3d.utils.universe.ViewInfo class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="ViewInfo (Java 3D 1.5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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="../../../../../com/sun/j3d/utils/universe/ViewerAvatar.html" title="class in com.sun.j3d.utils.universe"><B>PREV CLASS</B></A> <A HREF="../../../../../com/sun/j3d/utils/universe/ViewingPlatform.html" title="class in com.sun.j3d.utils.universe"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/sun/j3d/utils/universe/ViewInfo.html" target="_top"><B>FRAMES</B></A> <A HREF="ViewInfo.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> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.j3d.utils.universe</FONT><BR>Class ViewInfo</H2><PRE>java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.j3d.utils.universe.ViewInfo</B></PRE><HR><DL><DT><PRE>public class <B>ViewInfo</B><DT>extends java.lang.Object</DL></PRE><P>Provides methods to extract synchronized transform information from a View. These transforms are derived from application scene graph information, as opposed to similar core Java 3D methods that derive transforms from internally maintained data. This allows updates to the scene graph to be synchronized with the current view platform position.<p> The architecture of the Java 3D 1.3 sample implementation introduces a frame latency between updates to the application scene graph structure and their effects on internal Java 3D state. <code>getImagePlateToVworld</code> and other methods in the core Java 3D classes use a transform from view platform coordinates to virtual world coordinates that can be out of date with respect to the state of the view platform as set by the application. When an application uses the transforms returned by those methods to update view dependent parts of the scene graph, those updates might not be synchronized with what the viewer actually sees.<p> The methods in this class work around this problem at the expense of querying the application state of the scene graph to get the current transform from view platform to virtual world coordinates. This can involve a potential performance degradation, however, since the application scene graph state is not designed for high performance queries. The view platform must also have <code>ALLOW_LOCAL_TO_VWORLD_READ</code> capability set, which potentially inhibits internal scene graph optimization.<p> On the other hand, application behaviors that create the view platform transformation directly will have access to it without the need to query it from the scene graph; in that case, the transforms from physical coordinates to view platform coordinates provided by this class are all that are needed. The <code>ALLOW_LOCAL_TO_VWORLD_READ</code> view platform capability doesn't need to be set for these applications.<p> <b>Other Synchronization Issues</b><p> Scene graph updates are guaranteed to take effect in the same frame only if run from the processStimulus() method of a Behavior. Updates from multiple behaviors are only guaranteed to take effect in the same frame if they're responding to a WakeupOnElapsedFrames(0) condition. Use a single behavior to perform view dependent updates if possible; otherwise, use WakeupOnElapsedFrames(0) and set behavior scheduling intervals to ensure that behaviors that need the current view platform transform are run after it's set. Updating scene graph elements from anything other than the Behavior thread, such as an external input thread or a renderer callback in Canvas3D, will not necessarily be synchronized with rendering.<p> Direct updates to geometry data have a different frame latency than updates to scene graph transforms and structure. In the Java 3D 1.3 architecture, updates to by-reference geometry arrays and texture data have a 1-frame latency, while updates to transforms and scene graph structure have a 2-frame latency. Because of bug 4799494, which is outstanding in Java 3D 1.3.1, updates to by-copy geometry arrays also have a 1-frame latency. It is therefore recommended that view dependent scene graph updates be limited to transforms and scene graph structure only.<p> If it is not possible to avoid updating geometry directly, then these updates must be delayed by one frame in order to remain synchronized with the view platform. This can be accomplished by creating an additional behavior to actually update the geometry, separate from the behavior that computes the changes that need to be made based on current view state. If the update behavior is awakened by a behavior post from the computing behavior then the update will be delayed by a single frame.<p> <b>Implementation Notes</b><p> This utility is essentially a rewrite of a few private Java 3D core classes, but designed for public use and source code availability. The source code may be helpful in understanding some of the more complex aspects of the view model, especially with regards to various interactions between attributes which are not adequately documented. None of the actual core Java 3D source code is used, but the code is designed to comply with the view model as defined by the Java 3D Specification, so it can be considered an alternative implementation. This class will produce the same results as the Java 3D core implementation except for:<p><ul> <li>The frame latency issue for virtual world transforms.</li><p> <li>Active clip node status. If a clip node is active in the scene graph, it should override the view's back clip plane. This class has no such information, so this can't be implemented.</li><p> <li>"Infinite" view transforms for background geometry. These are simply the rotation components of the normal view transforms with adjusted clip planes. Again, this function depends upon scene graph content inaccessible to this class.</li><p> <li>Small floating point precision differences resulting from the alternative computations.</li><p> <li>Bugs in this class and the Java 3D core.</li><p> <li>Tracked head position.</li></ul><p> The last item deserves some mention. Java 3D provides no way to directly query the tracked head position being used by the renderer. The View's <code>getUserHeadToVworld</code> method always incorporates a virtual world transform that is out of date with respect to the application scene graph state. ViewInfo reads data from the head tracking sensor directly, but since head trackers are continuous input devices, getting the same data that the renderer is using is unlikely. See the source code for the private method <code>getHeadInfo</code> in this class for more information and possible workarounds.<p> <b>Thread Safety</b><p> All transforms are lazily evaluated. The <code>updateScreen</code>, <code>updateCanvas</code>, <code>updateViewPlatform</code>, <code>updateView</code>, and <code>updateHead</code> methods just set flags indicating that derived transforms need to be recomputed; they are safe to call from any thread. <code>updateCanvas</code>, for example, can safely be called from an AWT event listener.<p> Screens and view platforms can be shared between separate views in the Java 3D view model. To remain accurate, ViewInfo also allows this sharing. Since it is likely that a multi-view application has separate threads managing each view, potential concurrent modification of data associated with a screen or a view platform is internally synchronized in this class. It is safe for each thread to use its own instance of a ViewInfo corresponding to the view it is managing.<p> Otherwise, none of the other methods in this class are internally synchronized. <i>Except for the update methods mentioned above, a single instance of ViewInfo should not be used by more than one concurrent thread without external synchronization.</i><p><P><P><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -