Show raw api
{
"functions": [
{
"name": "new",
"desc": "Creates a new for the given Octree with the object.\n\n:::warning\nUse Octree:CreateNode() for more consistent results. To use this object directly\nyou need to set the position before it's registered which may be unclean.\n:::",
"params": [
{
"name": "octree",
"desc": "",
"lua_type": "Octree"
},
{
"name": "object",
"desc": "",
"lua_type": "T"
}
],
"returns": [
{
"desc": "",
"lua_type": "OctreeNode<T>"
}
],
"function_type": "static",
"private": true,
"source": {
"line": 37,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "KNearestNeighborsSearch",
"desc": "Finds the nearest neighbors to this node within the radius\n\n```lua\nlocal octree = Octree.new()\nlocal node = octree:CreateNode(Vector3.zero, \"A\")\noctree:CreateNode(Vector3.new(0, 0, 5), \"B\")\nprint(octree:KNearestNeighborsSearch(10, 100)) --> { \"A\", \"B\" } { 0, 25 }\n```",
"params": [
{
"name": "k",
"desc": "The number to retrieve",
"lua_type": "number"
},
{
"name": "radius",
"desc": "The radius to search in",
"lua_type": "number"
}
],
"returns": [
{
"desc": "Objects found, including self",
"lua_type": "{ T }"
},
{
"desc": "Distances squared",
"lua_type": "{ number }"
}
],
"function_type": "method",
"source": {
"line": 64,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "GetObject",
"desc": "Returns the object stored in the octree\n\n```lua\nlocal octree = Octree.new()\nlocal node = octree:CreateNode(Vector3.zero, \"A\")\nprint(octree:GetObject()) --> \"A\"\n```",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "T"
}
],
"function_type": "method",
"source": {
"line": 79,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "RadiusSearch",
"desc": "Finds the nearest neighbors to the octree node",
"params": [
{
"name": "radius",
"desc": "The radius to search in",
"lua_type": "number"
}
],
"returns": [
{
"desc": "Objects found",
"lua_type": "{ any }"
},
{
"desc": "Distances squared",
"lua_type": "{ number }"
}
],
"function_type": "method",
"source": {
"line": 90,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "GetPosition",
"desc": "Retrieves the position",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Vector3"
}
],
"function_type": "method",
"source": {
"line": 99,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "GetRawPosition",
"desc": "Retrieves the as px, py, pz",
"params": [],
"returns": [
{
"desc": "px",
"lua_type": "number"
},
{
"desc": "py",
"lua_type": "number"
},
{
"desc": "pz",
"lua_type": "number"
}
],
"function_type": "method",
"source": {
"line": 110,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "SetPosition",
"desc": "Sets the position of the octree nodes and updates the octree accordingly\n\n```lua\nlocal octree = Octree.new()\nlocal node = octree:CreateNode(Vector3.zero, \"A\")\nprint(octree:RadiusSearch(Vector3.zero, 100)) --> { \"A\" }\n\nnode:SetPosition(Vector3.new(1000, 0, 0))\nprint(octree:RadiusSearch(Vector3.zero, 100)) --> {}\n```",
"params": [
{
"name": "position",
"desc": "",
"lua_type": "Vector3"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 128,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
},
{
"name": "Destroy",
"desc": "Removes the OctreeNode from the octree",
"params": [],
"returns": [],
"function_type": "method",
"source": {
"line": 165,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
}
],
"properties": [],
"types": [],
"name": "OctreeNode",
"desc": "Basic node interacting with the octree. See [Octree](/api/Octree) for usage.\n\n```lua\nlocal octree = Octree.new()\nlocal node = octree:CreateNode(Vector3.zero, \"A\")\nprint(octree:RadiusSearch(Vector3.zero, 100)) --> { \"A\" }\n\nnode:Destroy() -- Remove node from octree\n\nprint(octree:RadiusSearch(Vector3.zero, 100)) --> { }\n```",
"source": {
"line": 15,
"path": "src/octree/src/Shared/OctreeNode.lua"
}
}