Module laneutil.nodeutil
Provides basic classes for node handling
Functions
| node (v, t[, id]) | Constructor returning nodeInstance |
| nodeManager (nodeClass[, precision=0.02]) | Constructor returning nodeManagerInstance |
Class nodeInstance
| nodeInstance:addTag (key, value) | Add a tag with any value to the node |
| nodeInstance:getTag (key) | Get the value of the specified tag |
| nodeInstance:removeTag (key) | Remove the specified tag and return its value |
Class nodeManagerInstance
| nodeManagerInstance:get (v, t) | Get a node with the given position and tangent |
| nodeManagerInstance:nodeList () | Returns all stored nodes in a simple list |
Functions
- node (v, t[, id])
-
Constructor returning nodeInstance
Parameters:
- v vec3
- t vec3
- id string (optional)
Returns:
- nodeManager (nodeClass[, precision=0.02])
-
Constructor returning nodeManagerInstance
Parameters:
- nodeClass node
- precision number (default 0.02)
Returns:
Class nodeInstance
Base class for nodes
- nodeInstance:addTag (key, value)
-
Add a tag with any value to the node
Parameters:
- key string
- value
Returns:
-
boolean
if setting the tag was successfull
- nodeInstance:getTag (key)
-
Get the value of the specified tag
Parameters:
- key string
Returns:
-
content of the tag or nil
- nodeInstance:removeTag (key)
-
Remove the specified tag and return its value
Parameters:
- key string
Returns:
-
content of the tag or nil
Class nodeManagerInstance
Stores all nodes and makes sure there aren't two identical nodes