Axiom.Math.AxisAlignedBox.Intersects C# (CSharp) Method

Intersects() public method

Tests whether the vector point is within this box.
public Intersects ( Vector3 vector ) : bool
vector Vector3
return bool
		public bool Intersects( Vector3 vector )
		{
			return ( vector.x >= minVector.x && vector.x <= maxVector.x &&
				vector.y >= minVector.y && vector.y <= maxVector.y &&
				vector.z >= minVector.z && vector.z <= maxVector.z );
		}

Same methods

AxisAlignedBox::Intersects ( AxisAlignedBox box2 ) : bool
AxisAlignedBox::Intersects ( Plane plane ) : bool
AxisAlignedBox::Intersects ( Sphere sphere ) : bool

Usage Example

Example #1
0
		// --- find nodes which intersect various types of BV's ---
		public override void FindNodes( AxisAlignedBox t,
									  ref List<PCZSceneNode> list,
									  List<Portal> visitedPortals,
									  bool includeVisitors,
									  bool recurseThruPortals,
									  PCZSceneNode exclude )
		{
			// if this zone has an enclosure, check against the enclosure AABB first
			if ( null != mEnclosureNode )
			{
				if ( !mEnclosureNode.WorldAABB.Intersects( t ) )
				{
					// AABB of zone does not intersect t, just return.
					return;
				}
			}

			foreach ( PCZSceneNode pczsn in mHomeNodeList )
			{
				if ( pczsn != exclude )
				{
					// make sure node is not already in the list (might have been added in another
					// zone it was visiting)
					if ( !list.Contains( pczsn ) )
					{
						bool nsect = t.Intersects( pczsn.WorldAABB );
						if ( nsect )
						{
							list.Add( pczsn );
						}
					}
				}
			}

			if ( includeVisitors )
			{
				// check visitor nodes
				foreach ( PCZSceneNode pczsn in mVisitorNodeList )
				{
					if ( pczsn != exclude )
					{
						// make sure node is not already in the list (might have been added in another
						// zone it was visiting)
						if ( !list.Contains( pczsn ) )
						{
							bool nsect = t.Intersects( pczsn.WorldAABB );
							if ( nsect )
							{
								list.Add( pczsn );
							}
						}
					}
				}
			}

			// if asked to, recurse through portals
			if ( recurseThruPortals )
			{
				foreach ( Portal portal in mPortals )
				{
					// check portal versus bounding box
					if ( portal.intersects( t ) )
					{
						// make sure portal hasn't already been recursed through
						if ( !visitedPortals.Contains( portal ) )
						{
							// save portal to the visitedPortals list
							visitedPortals.Add( portal );
							// recurse into the connected zone
							portal.getTargetZone().FindNodes( t,
																ref list,
																visitedPortals,
																includeVisitors,
																recurseThruPortals,
																exclude );
						}
					}
				}
			}
		}
All Usage Examples Of Axiom.Math.AxisAlignedBox::Intersects