Pathfinding.NavMeshGraph.ContainsPoint C# (CSharp) Method

ContainsPoint() public method

public ContainsPoint ( TriangleMeshNode node, Vector3 pos ) : bool
node TriangleMeshNode
pos UnityEngine.Vector3
return bool
		public bool ContainsPoint (TriangleMeshNode node, Vector3 pos) {
			if (	Polygon.IsClockwise ((Vector3)vertices[node.v0],(Vector3)vertices[node.v1], pos)
			    && 	Polygon.IsClockwise ((Vector3)vertices[node.v1],(Vector3)vertices[node.v2], pos)
			    && 	Polygon.IsClockwise ((Vector3)vertices[node.v2],(Vector3)vertices[node.v0], pos)) {
				return true;
			}
			return false;
		}
		

Same methods

NavMeshGraph::ContainsPoint ( TriangleMeshNode node, Vector3 pos, Int3 vertices ) : bool

Usage Example

Ejemplo n.º 1
0
        public bool NodeIntersectsCircle(MeshNode node, Vector3 p, float radius)
        {
            if (NavMeshGraph.ContainsPoint(node, p, graph.vertices))
            {
                return(true);
            }

            Int3[]  vertices = graph.vertices;
            float   r2 = radius * radius;
            Vector3 p1 = (Vector3)vertices[node[0]], p2 = (Vector3)vertices[node[1]], p3 = (Vector3)vertices[node[2]];

            p1.y = p.y;
            p2.y = p.y;
            p3.y = p.y;

            return(Mathfx.DistancePointSegmentStrict(p1, p2, p) < r2 ||
                   Mathfx.DistancePointSegmentStrict(p2, p3, p) < r2 ||
                   Mathfx.DistancePointSegmentStrict(p3, p1, p) < r2);
        }
All Usage Examples Of Pathfinding.NavMeshGraph::ContainsPoint