Pathfinding.GraphUpdateShape.Contains C# (CSharp) Method

Contains() public method

public Contains ( GraphNode node ) : bool
node GraphNode
return bool
		public bool Contains (GraphNode node) {
			
			Vector3 point = (Vector3)node.position;
			
			//Debug.DrawRay (node.position,-Vector3.up*2,Color.magenta);
			
			if (convex) {
				if (_convexPoints == null) return false;
				
				for (int i=0,j=_convexPoints.Length-1;i<_convexPoints.Length;j=i,i++) {
					if (Polygon.Left (_convexPoints[i],_convexPoints[j],point)) return false;
				}
			} else {
				if (_points	== null) return false;
				
				return Polygon.ContainsPoint (_points,point);
			}
			
			//Debug.DrawRay (node.position,Vector3.up*2,Color.blue);
			
			return true;
		}
		

Same methods

GraphUpdateShape::Contains ( Vector3 point ) : bool

Usage Example

Ejemplo n.º 1
0
        /** Updates the specified node using this GUO's settings */
        public virtual void Apply(GraphNode node)
        {
            if (shape == null || shape.Contains(node))
            {
                //Update penalty and walkability
                node.Penalty = (uint)(node.Penalty + addPenalty);
                if (modifyWalkability)
                {
                    node.Walkable = setWalkability;
                }

                //Update tags
                if (modifyTag)
                {
                    node.Tag = (uint)setTag;
                }
            }
        }
All Usage Examples Of Pathfinding.GraphUpdateShape::Contains