public static bool LineTest(Vector3 start, Vector3 end, uint layer) { NAV_VEC3 vStart = new NAV_VEC3(start); NAV_VEC3 vEnd = new NAV_VEC3(end); return(NavSystemImport.Nav_LineTest(ref vStart, ref vEnd, layer)); }
public static bool IsInNavigation(Vector3 pos) { NAV_VEC3 vPos = new NAV_VEC3(pos); float height = 0.0f; uint layer = 0; return(NavSystemImport.Nav_GetNavHeight(ref vPos, out height, out layer)); }
public static bool Nav_CalcPath(ref NAV_VEC3 start, ref NAV_VEC3 end, out NAV_VEC3[] pathBuffer) { IntPtr p; uint pathNodeCount = 0; bool rst = Nav_CalcPath(ref start, ref end, out p, ref pathNodeCount); CopyArrayFromPointer(out pathBuffer, p, (int)pathNodeCount); Nav_ReleasePath(ref p); return(rst); }
public static bool LineCast(Vector3 start, Vector3 end, uint layer, out Vector3 hitPoint) { NAV_VEC3 vStart = new NAV_VEC3(start); NAV_VEC3 vEnd = new NAV_VEC3(end); NAV_VEC3 vHitPoint; bool rst = NavSystemImport.Nav_LineCast(ref vStart, ref vEnd, layer, out vHitPoint); hitPoint = vHitPoint.ToVector3(); return(rst); }
public static bool RayCastNav(Vector3 start, Vector3 end, out Vector3 hitPos) { NAV_VEC3 vStart = new NAV_VEC3(start); NAV_VEC3 vEnd = new NAV_VEC3(end); NAV_VEC3 vHitPoint; bool rst = NavSystemImport.Nav_RayCastNav(ref vStart, ref vEnd, out vHitPoint); hitPos = vHitPoint.ToVector3(); return(rst); }
public static uint GetLayer(Vector3 pos) { NAV_VEC3 vPos = new NAV_VEC3(pos); uint layer; bool rst = NavSystemImport.Nav_GetLayer(ref vPos, out layer); if (!rst) { Debug.LogError("[navigation]获取layer失败"); } return(layer); }
public static bool LineCastEdge(Vector3 start, Vector3 end, uint layer, out Vector3 hitPoint, out Vector3 edgePoint0, out Vector3 edgePoint1) { NAV_VEC3 vStart = new NAV_VEC3(start); NAV_VEC3 vEnd = new NAV_VEC3(end); NAV_VEC3 vHitPoint, vEdgePoint0, vEdgePoint1; bool rst = NavSystemImport.Nav_LineCastEdge(ref vStart, ref vEnd, layer, out vHitPoint, out vEdgePoint0, out vEdgePoint1); hitPoint = vHitPoint.ToVector3(); edgePoint0 = vEdgePoint0.ToVector3(); edgePoint1 = vEdgePoint1.ToVector3(); return(rst); }
public static bool Nav_CalcLayerPath(Vector3 start, Vector3 end, uint layer, out Vector3[] path) { NAV_VEC3 vStart = new NAV_VEC3(start); NAV_VEC3 vEnd = new NAV_VEC3(end); NAV_VEC3[] pathBuffer; bool rst = NavSystemImport.Nav_CalcLayerPath(ref vStart, ref vEnd, layer, out pathBuffer); path = null; if (rst) { path = new Vector3[pathBuffer.Length]; for (int i = 0; i < pathBuffer.Length; ++i) { path[i] = pathBuffer[i].ToVector3(); } } return(rst); }
public static bool GetLayerHeight(Vector3 pos, uint layer, out float h) { NAV_VEC3 vPos = new NAV_VEC3(pos); return(NavSystemImport.Nav_GetLayerHeight(ref vPos, layer, out h)); }
public static extern bool Nav_LineTest(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer);
public static extern bool Nav_GetLayerHeight(ref NAV_VEC3 pos, uint layer, out float height);
public static extern bool Nav_GetNavHeight(ref NAV_VEC3 pos, out float height, out uint layer);
public static extern bool Nav_GetLayer(ref NAV_VEC3 pos, out uint layer);
public static extern bool Nav_CalcPath(ref NAV_VEC3 start, ref NAV_VEC3 end, out IntPtr pathBuffer, ref uint pathNodeCount);
public static extern bool Nav_RayCastNav(ref NAV_VEC3 start, ref NAV_VEC3 end, out NAV_VEC3 hitPos);
public static extern bool Nav_RayCastLayer(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer, out NAV_VEC3 hitPos);
public static extern bool Nav_LineCast(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer, out NAV_VEC3 hitPos);
public static extern bool Nav_LineCastEdge(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer, out NAV_VEC3 hitPos, out NAV_VEC3 edgePoint0, out NAV_VEC3 edgePoint1);