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
| Type | Property | Description | Standard |
|---|
Functions
| Return type | Function | Description | Standard |
|---|---|---|---|
| SFNode(String s) | Creates a new SFNode object.
The parameter | ||
| String | getNodeName() |
Returns the DEF name of the node. If the node is unnamed
| X3D3.0 |
| number | getNodeType() | Returns, in the array, a list of constant values that indicate node typess as provided in the X3DConstants object. BugNot implemented yet. | X3D3.0 |
| FieldDefinitionArray | getFieldDefinitions() | Returns an array of FieldDefinitions for the fields defined in the SFNode object.
| X3D3.0 |
| String | toVRMLString() | Returns the X3D Classic VRML-encoded string that, if parsed as the value of an SFNode field, would produce this node.
| X3D3.0 |
| String | toXMLString() | Returns the X3D XML-encoded string that, if parsed as the value of an SFNode field, would produce this node.
| X3D3.0 |
| String | toString() | 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 |
| MFNode | collectNodesByTypes(MFString nodeTypes) |
Collects all children for the given
| Avalon |
| SFNode | shootRay(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 |
| MFNode | getParents() | Returns all parents; Can be 0-n since X3D is a multi-parent scene graph.
| Avalon |
| Field | getField(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 |
| MFNode | getChildren() | Collects and returns all children of this node (from all its SF/MF-Node fields).
| Avalon |
| void | addChild(SFNode node) | Adds the given node or nodes (SFNode or MFNode) to the calling node.
| Avalon |
| void | removeChild(SFNode node) | Removes the given node or nodes (SFNode or MFNode) from the calling node.
| Avalon |
| MFMatrix4f | getWorldTransform() | Returns the world-transform for the given node; Can be 0-n since X3D is a multi-parent scene-graph.
| Avalon |
| bool | collide(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 |