private static Matrix4x4 PolygonWorldToLocalMatrix(IntPtr navMeshQuery, PolygonId polygon)
        {
            Matrix4x4 result;

            NavMeshQuery.PolygonWorldToLocalMatrix_Injected(navMeshQuery, ref polygon, out result);
            return(result);
        }
Пример #2
0
        public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
        {
            Vector3 nearest;
            var     status = GetClosestPointOnPoly(m_NavMeshQuery, polygon, position, out nearest);

            return((status & PathQueryStatus.Success) != 0 ? new NavMeshLocation(nearest, polygon) : new NavMeshLocation());
        }
        public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
        {
            AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
            Vector3         position2;
            PathQueryStatus closestPointOnPoly = NavMeshQuery.GetClosestPointOnPoly(this.m_NavMeshQuery, polygon, position, out position2);

            return(((closestPointOnPoly & PathQueryStatus.Success) != (PathQueryStatus)0) ? new NavMeshLocation(position2, polygon) : default(NavMeshLocation));
        }
        public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
        {
            AtomicSafetyHandle.CheckReadAndThrow(m_Safety);
            Vector3 nearest;
            var     status = GetClosestPointOnPoly(m_NavMeshQuery, polygon, position, out nearest);

            return((status & PathQueryStatus.Success) != 0 ? new NavMeshLocation(nearest, polygon) : new NavMeshLocation());
        }
        public unsafe PathQueryStatus GetEdgesAndNeighbors(PolygonId node, NativeSlice <Vector3> edgeVertices, NativeSlice <PolygonId> neighbors, NativeSlice <byte> edgeIndices, out int verticesCount, out int neighborsCount)
        {
            AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
            bool flag = edgeIndices.Length != neighbors.Length && neighbors.Length > 0 && edgeIndices.Length > 0;

            if (flag)
            {
                throw new ArgumentException(string.Format("The length of the {0} buffer ({1}) ", "edgeIndices", edgeIndices.Length) + string.Format("needs to be the same as that of the {0} buffer ({1}) ", "neighbors", neighbors.Length) + "because the elements from the two arrays will pair up at the same index.");
            }
            void *verts        = (edgeVertices.Length > 0) ? edgeVertices.GetUnsafePtr <Vector3>() : null;
            void *neighbors2   = (neighbors.Length > 0) ? neighbors.GetUnsafePtr <PolygonId>() : null;
            void *edgeIndices2 = (edgeIndices.Length > 0) ? edgeIndices.GetUnsafePtr <byte>() : null;
            int   length       = edgeVertices.Length;
            int   maxNei       = (neighbors.Length > 0) ? neighbors.Length : edgeIndices.Length;

            return(NavMeshQuery.GetEdgesAndNeighbors(this.m_NavMeshQuery, node, length, maxNei, verts, neighbors2, edgeIndices2, out verticesCount, out neighborsCount));
        }
        public unsafe PathQueryStatus GetEdgesAndNeighbors(PolygonId node,
                                                           NativeSlice <Vector3> edgeVertices, NativeSlice <PolygonId> neighbors, NativeSlice <byte> edgeIndices,
                                                           out int verticesCount, out int neighborsCount)
        {
            AtomicSafetyHandle.CheckReadAndThrow(m_Safety);

            if (edgeIndices.Length != neighbors.Length && neighbors.Length > 0 && edgeIndices.Length > 0)
            {
                throw new ArgumentException($"The length of the {nameof(edgeIndices)} buffer ({edgeIndices.Length}) " +
                                            $"needs to be the same as that of the {nameof(neighbors)} buffer ({neighbors.Length}) " +
                                            "because the elements from the two arrays will pair up at the same index.");
            }
            var vertPtr      = edgeVertices.Length > 0 ? edgeVertices.GetUnsafePtr() : null;
            var neiPtr       = neighbors.Length > 0 ? neighbors.GetUnsafePtr() : null;
            var edgesPtr     = edgeIndices.Length > 0 ? edgeIndices.GetUnsafePtr() : null;
            var maxVertices  = edgeVertices.Length;
            var maxNeighbors = neighbors.Length > 0 ? neighbors.Length : edgeIndices.Length;
            var status       = GetEdgesAndNeighbors(m_NavMeshQuery, node, maxVertices, maxNeighbors,
                                                    vertPtr, neiPtr, edgesPtr,
                                                    out verticesCount, out neighborsCount);

            return(status);
        }
 public Matrix4x4 PolygonWorldToLocalMatrix(PolygonId polygon)
 {
     AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
     return(NavMeshQuery.PolygonWorldToLocalMatrix(this.m_NavMeshQuery, polygon));
 }
Пример #8
0
 public NavMeshPolyTypes GetPolygonType(PolygonId polygon)
 {
     return(GetPolygonType(m_NavMeshQuery, polygon));
 }
 private static extern bool IsPositionInPolygon_Injected(IntPtr navMeshQuery, ref Vector3 position, ref PolygonId polygon);
Пример #10
0
 private static extern bool IsValidPolygon_Injected(IntPtr navMeshQuery, ref PolygonId polygon);
Пример #11
0
 private unsafe static PathQueryStatus GetEdgesAndNeighbors(IntPtr navMeshQuery, PolygonId node, int maxVerts, int maxNei, void *verts, void *neighbors, void *edgeIndices, out int vertCount, out int neighborsCount)
 {
     return(NavMeshQuery.GetEdgesAndNeighbors_Injected(navMeshQuery, ref node, maxVerts, maxNei, verts, neighbors, edgeIndices, out vertCount, out neighborsCount));
 }
Пример #12
0
 public int GetAgentTypeIdForPolygon(PolygonId polygon)
 {
     AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
     return(NavMeshQuery.GetAgentTypeIdForPolygon(this.m_NavMeshQuery, polygon));
 }
Пример #13
0
 private static int GetAgentTypeIdForPolygon(IntPtr navMeshQuery, PolygonId polygon)
 {
     return(NavMeshQuery.GetAgentTypeIdForPolygon_Injected(navMeshQuery, ref polygon));
 }
Пример #14
0
 public bool IsValid(PolygonId polygon)
 {
     AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
     return(polygon.polyRef != 0uL && NavMeshQuery.IsValidPolygon(this.m_NavMeshQuery, polygon));
 }
Пример #15
0
 private static bool IsValidPolygon(IntPtr navMeshQuery, PolygonId polygon)
 {
     return(NavMeshQuery.IsValidPolygon_Injected(navMeshQuery, ref polygon));
 }
Пример #16
0
 internal NavMeshLocation(Vector3 position, PolygonId polygon)
 {
     this.< position > k__BackingField = position;
     this.< polygon > k__BackingField  = polygon;
 }
Пример #17
0
 internal NavMeshLocation(Vector3 position, PolygonId polygon)
 {
     this.position = position;
     this.polygon  = polygon;
 }
Пример #18
0
 private static NavMeshPolyTypes GetPolygonType(IntPtr navMeshQuery, PolygonId polygon)
 {
     return(NavMeshQuery.GetPolygonType_Injected(navMeshQuery, ref polygon));
 }
Пример #19
0
 public NavMeshPolyTypes GetPolygonType(PolygonId polygon)
 {
     AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
     return(NavMeshQuery.GetPolygonType(this.m_NavMeshQuery, polygon));
 }
Пример #20
0
 private static bool IsPositionInPolygon(IntPtr navMeshQuery, Vector3 position, PolygonId polygon)
 {
     return(NavMeshQuery.IsPositionInPolygon_Injected(navMeshQuery, ref position, ref polygon));
 }
Пример #21
0
 private static PathQueryStatus GetClosestPointOnPoly(IntPtr navMeshQuery, PolygonId polygon, Vector3 position, out Vector3 nearest)
 {
     return(NavMeshQuery.GetClosestPointOnPoly_Injected(navMeshQuery, ref polygon, ref position, out nearest));
 }
Пример #22
0
 private static extern bool GetPortalPoints_Injected(IntPtr navMeshQuery, ref PolygonId polygon, ref PolygonId neighbourPolygon, out Vector3 left, out Vector3 right);
Пример #23
0
 private static extern int GetAgentTypeIdForPolygon_Injected(IntPtr navMeshQuery, ref PolygonId polygon);
Пример #24
0
 private static extern NavMeshPolyTypes GetPolygonType_Injected(IntPtr navMeshQuery, ref PolygonId polygon);
Пример #25
0
 private static extern PathQueryStatus GetClosestPointOnPoly_Injected(IntPtr navMeshQuery, ref PolygonId polygon, ref Vector3 position, out Vector3 nearest);
Пример #26
0
 static extern NavMeshPolyTypes GetPolygonType(IntPtr navMeshQuery, PolygonId polygon);
Пример #27
0
 private static extern void PolygonWorldToLocalMatrix_Injected(IntPtr navMeshQuery, ref PolygonId polygon, out Matrix4x4 ret);
Пример #28
0
 private static bool GetPortalPoints(IntPtr navMeshQuery, PolygonId polygon, PolygonId neighbourPolygon, out Vector3 left, out Vector3 right)
 {
     return(NavMeshQuery.GetPortalPoints_Injected(navMeshQuery, ref polygon, ref neighbourPolygon, out left, out right));
 }
Пример #29
0
 private unsafe static extern PathQueryStatus GetEdgesAndNeighbors_Injected(IntPtr navMeshQuery, ref PolygonId node, int maxVerts, int maxNei, void *verts, void *neighbors, void *edgeIndices, out int vertCount, out int neighborsCount);
Пример #30
0
 public bool GetPortalPoints(PolygonId polygon, PolygonId neighbourPolygon, out Vector3 left, out Vector3 right)
 {
     AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety);
     return(NavMeshQuery.GetPortalPoints(this.m_NavMeshQuery, polygon, neighbourPolygon, out left, out right));
 }