instantreality 1.0

Browser

All browser services are encapsulated through two host objects: Browser and ExternalBrowser.

The Browser object cannot be instantiated directly.

Properties

TypePropertyDescriptionStandard
Stringname

A browser-implementation specific string describing the browser. The InstantPlayer returns "Avalon" which is the name of the InstantPlayer X3D-Engine. [read only].

X3D3.0
Stringversion

A browser-implementation specific string describing the browser version. [read only].

X3D3.0
numericcurrentSpeed

If this is not supported, the string "0.0" is returned. [read only].

X3D3.0
numericcurrentFrameRate

If this is not supported, the string "0.0" is returned. [read only].

X3D3.0
Stringdescription

A description of the browser object. [read/write].

X3D3.0
ComponentInfoArraysupportedComponents

The property value cannot be changed, but the properties of the ComponentInfoArray can be [read only].

X3D3.0
ProfileInfoArraysupportedProfiles

The property value cannot be changed, but the properties of the ProfileInfoArray can be [read only].

X3D3.0
ScenecurrentScene

The real type of this class is dependent on whether the user code is inside a prototype instance or not. If the user code is inside a prototype instance the property shall represent a ExecutionContext otherwise it shall represent a Scene. [read only].

X3D3.0

Functions

Return typeFunctionDescriptionStandard
StringgetName()

A browser-implementation specific string describing the browser.

DeprecatedUse the Browser.name property instead.

X3D2.0
StringgetVersion()

A browser-implementation specific string describing the browser version (VRML SAI).

DeprecatedUse the Browser.version property instead.

X3D2.0
numericgetCurrentSpeed()

If this is not supported, the string "0.0" is returned (VRML SAI).

DeprecatedUse the Browser.currentSpeed property instead.

X3D2.0
numericgetCurrentFrameRate()

If this is not supported, the string "0.0" is returned (VRML SAI).

DeprecatedUse the Browser.currentFrameRate property instead.

X3D2.0
StringgetWorldURL()

Returns the URL for the root of the currently loaded world.

DeprecatedUse the Browser.currentScene worldURL property instead.

X3D2.0
voidreplaceWorld(Object value)

Replace the current world with this new scene that has been loaded or constructed from somewhere. Note that the signature for this function differs in the X3D2.0 and X3D3.0 specification. Therefore the Object can be a MFNode or an Scene instance.

X3D2.0, X3D3.0
MFNodecreateVrmlFromString(String vrml97Syntax)

The string may be any valid VRML content in classic encoding. Returns the content created from the given string.

X3D2.0
voidcreateVrmlFromURL(MFString url, SFNode node, String event)

Parse the data in url into a VRML scene. When complete send event to node. The event parameter is a string with the name of an MFNode eventIn in the passed node. For instance, if node were a Transform, event would be "<tt>add_children</tt>". When the url is loaded and the scene is parsed, the resulting nodes will be added as children of the Transform.

X3D2.0
voidaddRoute(SFNode fromNode, String fromEventOut, SFNode toNode, String toEventIn)

Add the route fromNode.fromEventOut TO toNode.toEventIn.

X3D2.0
voiddeleteRoute(SFNode fromNode, String fromEventOut, SFNode toNode, String toEventIn)

Remove the route fromNode.fromEventOut TO toNode.toEventIn, if one exists.

X3D2.0
voidloadURL(MFString url, MFString parameter)

Loads the first recognized URL from the specified url field with the passed parameters.

The parameter and url arguments are treated identically to the Anchor node's parameter and url fields. This method returns immediately. However, if the URL is loaded into this browser window (e.g., there is no TARGET parameter to redirect it to another frame), the current world will be terminated and replaced with the data from the specified URL at some time in the future. Scripts that may call this method shall set mustEvaluate to TRUE. If loadURL() is invoked with a URL of the form "#name", the Viewpoint node with the given name ("name") in the Script' node's run-time name scope(s) shall be bound. However, if the Script node containing the script that invokes loadURL("#name") is not part of any run-time name scope or is part of more than one run-time name scope, results are undefined.

X3D2.0
voidsetDescription(String description)

Sets the passed string as the current description. This message is displayed in a browser dependent manner. An empty string clears the current description. Scripts that call this method shall have mustEvaluate set to TRUE.

DeprecatedUse the Browser.description read/write property instead.

X3D2.0
ScenecreateX3DFromString(String x3dSyntax)

Create a scene from the given code. The string may be any valid X3D content in any language supported by the browser implementation. If the browser does not support the content encoding the appropriate exception shall be thrown.

X3D3.0
ScenecreateX3DFromURL(MFString url, String callbackName, Object obj)

Create a scene from the given list of urls.

If the callbackName and obj parameter is given, the method is asynchronous and the function callbackName of the given obj is called when the url list has been loaded. The return value is always null in this case. If the callback arguments callbackName and obj are not given, the method becomes synchronous and returns the scene from the completed load process, if it succeeded. BugNot implemented yet!

X3D3.0
SceneimportDocument(DOMNode domNode)

Create a scene from the given DOMNode.

BugNot implemented yet!

X3D3.0
StringgetRenderingProperty(String name)

Returns the renderingProperty for the given name. All properties are converted to a string internally, even when their normal native type would be an numeric value.

BugNot implemented yet!

X3D3.0
voidprint(Object o)

Prints the object to the browser's console without a newline character. Successive calls to this function append the descriptions on the same line. The output is the implicit call to the object's toString() function.

X3D3.0
voidprintln(Object o)

Prints the object to the browser's console, inserting a newline character after the output. Successive calls to this function will result in each output presented on separate lines. The output is the implicit call to the object's toString() function.

X3D3.0
ViewgetView(String name)

Returns the view with the given name;.

name must be the description of a Viewarea or Layer. Returns the first/default view without argument

Avalon