NavMesh: Difference between revisions
From Crumbled World Wiki
(Created page with "{{:SceneNodeExampleCode}} ==Functions== {| class="wikitable" !|return !|function !|description |- |{ { { island=Island(), position=Vec3() } } } |getHull() |Return a list of all navmesh hulls. Every Navmesh hull then have a list of sub hulls where the first hull is the exterior and remaining subhull is internal that creates hole in the navMesh. |- |{ { island=Island(),position=Vec3() } } |NavMesh:getPath(float npcSize, Object point...") |
(No difference)
|
Latest revision as of 12:59, 5 July 2025
Example Code
function done()
--Do stuff here
end
--Run exportScript.lua in a background thread.
local worker = Worker("MapEditor/exportScript.lua",false)
worker:addCallbackFinished(done)
Functions
| return | function | description |
|---|---|---|
| { { { island=Island(), position=Vec3() } } } | getHull() | Return a list of all navmesh hulls. Every Navmesh hull then have a list of sub hulls where the first hull is the exterior and remaining subhull is internal that creates hole in the navMesh. |
| { { island=Island(),position=Vec3() } } | getPath(float npcSize, Object point1, Object point2) | Point1 and point 2 need to contain following information {island=SceneNode(),position=Vec3()} where the sceneNode need to be an island or have an island betwen this node and the root node. position is a local position to the island.
Return a path. The path is a list of points, where every point has the island to witch the point is conected and the position on the island. |
| { { island=Island(),position=Vec3() } } | getPath(float npcSize, SceneNode island1, Vec3 localPosition1, SceneNode island2, Vec3 localPosition2) | Return a path. The path is a list of points, where every point has the island to witch the point is conected and the position on the island. |
| addDirectionalPoint(Vec3 globalPosition, Vec3 globalDirection) | Convert one convex hull to directional. |