instantreality 1.0

SFNode

The SFNode object corresponds to an X3D SFNode field.

There are no explicitly defined properties. An SFNode instance can be created using the SFNode() constructor.

Properties

TypePropertyDescriptionStandard

Functions

Return typeFunctionDescriptionStandard
SFNode(String s)

Creates a new SFNode object.

The parameter s can be a nodetype name or a node declaration in either X3D or VRML97 encoding. E.g.:var n1 = new SFNode('Box'); var n2 = new SFNode('Box {}'); var n3 = new SFNode('<Box />'); These examples instantiate a new Box node using the different constructor variants.

StringgetNodeName()

Returns the DEF name of the node. If the node is unnamed null is returned.

X3D3.0
numbergetNodeType()

Returns, in the array, a list of constant values that indicate node typess as provided in the X3DConstants object.

BugNot implemented yet.

X3D3.0
FieldDefinitionArraygetFieldDefinitions()

Returns an array of FieldDefinitions for the fields defined in the SFNode object.

X3D3.0
StringtoVRMLString()

Returns the X3D Classic VRML-encoded string that, if parsed as the value of an SFNode field, would produce this node.

X3D3.0
StringtoXMLString()

Returns the X3D XML-encoded string that, if parsed as the value of an SFNode field, would produce this node.

X3D3.0
StringtoString()

Returns the X3D Classic VRML-encoded string that, if parsed as the value of an SFNode field, would produce this node.

DeprecatedVRML97 ECMAScript - use the toVRMLString() or toXMLString() method

X3D2.0
MFNodecollectNodesByTypes(MFString nodeTypes)

Collects all children for the given nodeTypes (identified by name).

Avalon
SFNodeshootRay(SFVec3f rayPos, SFVec3f rayDir, String NodeType, SFVec3f pickPos, SFVec3f pickNormal)

returns the first picked node (or null) for the given rayPos,rayNormal and nodeType, optional rayPosition and rayNormals are assigned

Avalon
MFNodegetParents()

Returns all parents; Can be 0-n since X3D is a multi-parent scene graph.

Avalon
FieldgetField(String name)

Returns a single Field object (not value) for the given name or index; Use Foo.bar instead of Foo.getField('bar') to get the value.

Avalon
MFNodegetChildren()

Collects and returns all children of this node (from all its SF/MF-Node fields).

Avalon
voidaddChild(SFNode node)

Adds the given node or nodes (SFNode or MFNode) to the calling node.

Avalon
voidremoveChild(SFNode node)

Removes the given node or nodes (SFNode or MFNode) from the calling node.

Avalon
MFMatrix4fgetWorldTransform()

Returns the world-transform for the given node; Can be 0-n since X3D is a multi-parent scene-graph.

Avalon
boolcollide(SFNode node)

Checks for collision between the calling node and a given SF- or MFNode. Returns true, if the calling node and one of the given Nodes collide.

Avalon