Exemple #1
0
    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));
    }
Exemple #2
0
    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));
    }
Exemple #3
0
    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);
    }
Exemple #4
0
        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);
        }
Exemple #5
0
    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);
    }
Exemple #6
0
    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);
    }
Exemple #7
0
    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);
    }
Exemple #8
0
    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);
    }
Exemple #9
0
    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));
    }
Exemple #10
0
 public static extern bool Nav_LineTest(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer);
Exemple #11
0
 public static extern bool Nav_GetLayerHeight(ref NAV_VEC3 pos, uint layer, out float height);
Exemple #12
0
 public static extern bool Nav_GetNavHeight(ref NAV_VEC3 pos, out float height, out uint layer);
Exemple #13
0
 public static extern bool Nav_GetLayer(ref NAV_VEC3 pos, out uint layer);
Exemple #14
0
 public static extern bool Nav_CalcPath(ref NAV_VEC3 start, ref NAV_VEC3 end, out IntPtr pathBuffer, ref uint pathNodeCount);
Exemple #15
0
 public static extern bool Nav_RayCastNav(ref NAV_VEC3 start, ref NAV_VEC3 end, out NAV_VEC3 hitPos);
Exemple #16
0
 public static extern bool Nav_RayCastLayer(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer, out NAV_VEC3 hitPos);
Exemple #17
0
 public static extern bool Nav_LineCast(ref NAV_VEC3 start, ref NAV_VEC3 end, uint layer, out NAV_VEC3 hitPos);
Exemple #18
0
 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);