📄 config-syntax.html
字号:
unexpectedly when the virtual world scaling changed as the result of a windowresize. The quirk can be avoided by using the <code>VIRTUAL_EYE</code> or<code>VIRTUAL_SCREEN</code> clip policies or by using the<code>VIRTUAL_WORLD</code> resize policy, but in most cases the effect isbenign and doesn't lead to unexpected results.</p><h4><a NAME="FieldOfView"></a>FieldOfView</h4>This number is the view's horizontal field of view in radians. The defaultvalue is PI/4. This value is ignored if WindowEyepointPolicy is not<code>RELATIVE_TO_FIELD_OF_VIEW</code> or if head tracking is enabled. Theeyepoint for each canvas associated with the view is set such that it iscentered in X and Y, with the Z value at the appropriate distance to match thespecified field of view across the width of the canvas.<h4><a NAME="StereoEnable"></a>StereoEnable</h4>Enable or disable stereo viewing for this view according to the boolean valuespecified by the <i>property value</i> string. The default value is false.<p>There is no actual method in the core Java 3D View or utility Viewer class toenable stereo. A true value for this property causes ConfigContainer toattempt to create stereo-capable canvases for all the screens associated withthis view. Stereo will then be enabled for each canvas successfully createdwith stereo capability.</p><h4><a NAME="TrackingEnable"></a>TrackingEnable</h4>Enable or disable head tracking for this view according to the boolean valuespecified by the <i>property value</i> string. The default value is false.<p>Setting this property true causes WindowEyepointPolicy to be ignored; it willeffectively be <code>RELATIVE_TO_COEXISTENCE</code> with the eyepoint incoexistence coordinates computed from reading the head tracking sensor.Tracking must be made available by registering an input device and a headtracking sensor in PhysicalEnvironment.</p><h4><a NAME="AntialiasingEnable"></a>AntialiasingEnable</h4>Enable or disable scene antialiasing for this view according to the booleanvalue specified by the <i>property value</i> string. The default value isfalse.<p>A true value for this property causes ConfigContainer to attempt to createa canvas capable of scene antialiasing on each screen associated with thisview. The scene will then be antialiased on each canvas successfully createdwith that capability.</p><p>Line and point antialiasing are independent of scene antialiasing and arecontrolled by the LineAttribute and PointAttribute components of an Appearance.If line and point antialiasing is enabled, then they will be antialiased priorto scene antialiasing; if scene antialiasing is turned off, then antialiasedlines and points will still be antialiased.</p></blockquote><hr><h2><a NAME="NewViewPlatform"></a>NewViewPlatform</h2><b>Syntax:</b><br>(NewViewPlatform <i><instance name></i>[Alias <i><alias name></i>])<p>Creates a new view platform and binds it to the name given by <i>instancename</i>. In the configuration file the term <i>view platform</i> refers to aninstance of the <a href="../ViewingPlatform.html">ViewingPlatform</a> utilityclass, which is an extension of BranchGroup containing an instance of a coreJava 3D ViewPlatform class.</p><p>The last two arguments are optional and define an alias for <i>instancename</i>. This is useful in providing a longer descriptive name for theapplication to recognize, or conversely, to provide a shorter alias for alonger instance name. Either name may be used to identify the instance.</p><hr><h2><a NAME="ViewPlatformProperty"></a>ViewPlatformProperty</h2><b>Syntax:</b><br>(ViewPlatformProperty <i><instance name> <property name><property value></i>)<p>Sets a ViewPlatform property. The instance is specified by <i>instancename</i>, the property to be set by <i>property name</i>, and the value to beset by <i>property value</i>. The following properties are configurable:</p><blockquote><h4><a NAME="NominalViewingTransform"></a>NominalViewingTransform</h4>The <i>property value</i> is a boolean string indicating whether or notthe view platform should be backed up in Z to allow objects at the origin to beviewed. This only has effect if the ViewAttachPolicy is<code>NOMINAL_HEAD</code>. The default value is false. See the<a href="../ViewingPlatform.html#setNominalViewingTransform()">setNominalViewingTransform</a>method of ViewingPlatform.<h4><a NAME="InitialViewingTransform"></a>InitialViewingTransform</h4>Sets the initial transform of the view platform to the 4D matrixspecified by <i>property value</i>. The default value is identity.<h4><a NAME="AllowPolicyRead"></a>AllowPolicyRead</h4>The <i>property value</i> is a boolean string indicating whether or not readingthe ViewAttachPolicy is allowed. The default value is false.<h4><a NAME="AllowLocalToVworldRead"></a>AllowLocalToVworldRead</h4>The <i>property value</i> is a boolean string indicating whether or not readingthe view platform's localToVworld transform is allowed. The default value isfalse. <h4><a NAME="ViewPlatformBehavior"></a>ViewPlatformBehavior</h4>Attaches a ViewPlatformBehavior instantiated by <a href="#NewViewPlatformBehavior">NewViewPlatformBehavior</a>.The <i>property value</i> string is the name bound to that instance.<h4><a NAME="ViewAttachPolicy"></a>ViewAttachPolicy</h4>The <i>property value</i> string can be one of <code>NOMINAL_SCREEN,NOMINAL_HEAD,</code> or <code>NOMINAL_FEET</code>. This establishes the pointin coexistence coordinates where the origin of view platform coordinates isattached. The basis vectors of view platform coordinates are always alignedwith those of coexistence coordinates.<p>For a ViewAttachPolicy of <code>NOMINAL_SCREEN</code>, the ViewPlatform originis set directly to the origin of coexistence, so that ViewPlatform coordinatesand coexistence coordinates are identical except for scale.</p><p>For a ViewAttachPolicy of <code>NOMINAL_HEAD</code>, the ViewPlatform origin isset to the origin of the nominal head, the center eye halfway between the leftand right eyes. The nominal head origin is on the Z axis of coexistencecoordinates at some offset from the coexistence origin. If theWindowEyepointPolicy is <code>RELATIVE_TO_FIELD_OF_VIEW</code>, then this isthe positive Z offset producing the required field of view relative to thewidth of the canvas at the coexistence origin, tracking the Z offset of theeyepoint defined by that policy; otherwise, the Z offset is theNominalEyeOffsetFromNominalScreen property of PhysicalBody and is decoupledfrom the actual eyepoint offset.</p><p>For a ViewAttachPolicy of <code>NOMINAL_FEET</code>, the ViewPlatform origin isat the ground plane, which is NominalEyeHeightFromGround meters along -Y fromthe origin of the nominal head. NominalEyeHeightFromGround is a property ofPhysicalBody.</p><p><b>Note:</b> The normal Java 3D default is <code>NOMINAL_HEAD</code>. Whenusing a configuration file, the default is <code>NOMINAL_HEAD</code> only ifevery view attached to the view platform has a WindowEyepointPolicy of<code>RELATIVE_TO_FIELD_OF_VIEW</code>; otherwise, the default is<code>NOMINAL_SCREEN</code>. If the view policy is <code>HMD_VIEW</code>, thenthe ViewAttachPolicy is ignored and is always effectively<code>NOMINAL_SCREEN</code>.</p></blockquote><hr><h2><a NAME="NewViewPlatformBehavior"></a>NewViewPlatformBehavior</h2><b>Syntax:</b><br>(NewViewPlatformBehavior <i><instance name> <class name></i>[Alias <i><alias name></i>])<p>This command instantiates the concrete subclass of ViewPlatformBehaviorspecified by the fully qualified <i>class name</i> and binds it to <i>instancename</i>. The ViewPlatformBehavior is instantiated through introspection ofthe class name. The subclass must provide a parameterless constructor. If nosuch constructor is available, then the behavior must be extended or wrapped toprovide one and the derived class used instead.</p><p>The last two arguments are optional and define an alias for <i>instancename</i>. This is useful in providing a longer descriptive name for theapplication to recognize, or conversely, to provide a shorter alias for alonger instance name. Either name may be used to identify the instance.</p><p>View platform behaviors often need sensors or canvases as event sources todrive the behavior action. A subclass of ViewPlatformBehavior always gets thecurrent ViewingPlatform through its <a href="../../behaviors/vp/ViewPlatformBehavior.html#setViewingPlatform(com.sun.j3d.utils.universe.ViewingPlatform)">setViewingPlatform</a>method. When the behavior is initialized, the canvases used by theViewingPlatform can be retrieved by calling its <a href="../ViewingPlatform.html#getViewers()">getViewers</a> method andthen calling each Viewer's <a href="../Viewer.html#getCanvas3Ds()">getCanvas3Ds</a> method. Sensors can be retrieved by calling the ViewingPlatform method <a href="../ViewingPlatform.html#getUniverse()">getUniverse</a>, checking to see if the returned SimpleUniverse is a ConfiguredUniverse, and then callingits <a href="../ConfiguredUniverse.html#getNamedSensors()">getNamedSensors</a>method.</p> <p>Alternatively, the behavior implementation can define its own properties and receive canvas and sensor instances directly through the<a href="#Canvas3D">Canvas3D</a> and <a href="#Sensor">Sensor</a> built-incommands.</p><hr><h2><a NAME="ViewPlatformBehaviorProperty"></a>ViewPlatformBehaviorProperty</h2><b>Syntax:</b><br>(ViewPlatformBehaviorProperty <i><instance name><property name> <property value></i>)<p>Sets a property of a ViewPlatformBehavior. The instance is specified by<i>instance name</i>, the property to be set by <i>property name</i>, and thevalue to be set by <i>property value</i>. The following properties arepre-defined by the abstract ViewPlatformBehavior superclass and may beconfigured directly:<p><blockquote><h4><a NAME="SchedulingBounds"></a>SchedulingBounds</h4>The scheduling bounds for this behavior. Use the <a href="#BoundingSphere">BoundingSphere</a> built-in command to set thisproperty. The default is whatever the application or the concrete subclasssets.<h4><a NAME="SchedulingInterval"></a>SchedulingInterval</h4>A number indicating the scheduling interval for this behavior. See the <a href="../../../../../../javax/media/j3d/Behavior.html#setSchedulingInterval(int)">setSchedulingInterval</a>method of Behavior.<h4><a NAME="HomeTransform"></a>HomeTransform</h4>See the ViewPlatformBehavior method <a href="../../behaviors/vp/ViewPlatformBehavior.html#setHomeTransform(javax.media.j3d.Transform3D)">setHomeTransform</a>.The property value must be a 4D matrix.</blockquote><p>The details of a concrete subclass of ViewPlatformBehavior are not known toConfigContainer, so any properties specific to the subclass are set byusing introspection to invoke <i>property name</i> as a method accepting anarray of Objects as its single parameter. The arguments following the propertyname are evaluated and the results passed to the method through that array ofObjects. Such methods can usually be provided by extending or wrappingexisting ViewPlatformBehavior implementations.</p><hr><h2><a NAME="NewObject"></a>NewObject</h2><b>Syntax:</b><br>(NewObject <i><instance name> <class name></i>[Alias <i><alias name></i>])<p>This command instantiates a generic object specified by <i>classname</i> and binds it to <i>instance name</i>. The object is instantiatedthrough introspection of the class name. The object must provide aparameterless constructor; this can usually be done by extending orwrapping existing objects.</p> <p>The last two arguments are optional and define an alias for <i>instancename</i>. This is useful in providing a longer descriptive name for theapplication to recognize, or conversely, to provide a shorter alias for alonger instance name. Either name may be used to identify the instance.</p><p>Objects so defined may be accessed from ConfigContainer through the<a href="../ConfigContainer.html#getNamedGenericObjects()">getNamedGenericObjects</a> method.</p><hr><h2><a NAME="ObjectProperty"></a>ObjectProperty</h2><b>Syntax:</b><br>(ObjectProperty <i><instance name> <method name> <arg0> ... <argn></i>)<p>Sets a property of a generic object. The details of the object specified by<i>instance name</i> are not known to ConfigContainer, so any parameters to beset through the configuration file are passed to the object instance byinvoking <i>method name</i> through introspection. The arguments
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -