Axiom.SceneManagers.Bsp.BspLevel.TagNodesWithObject C# (CSharp) Method

TagNodesWithObject() protected method

protected TagNodesWithObject ( Axiom.SceneManagers.Bsp.BspNode node, Axiom.Core.MovableObject obj, Vector3 pos ) : void
node Axiom.SceneManagers.Bsp.BspNode
obj Axiom.Core.MovableObject
pos Vector3
return void
		protected void TagNodesWithObject( BspNode node, MovableObject obj, Vector3 pos )
		{
			if ( node.IsLeaf )
			{
				// Add to movable->node map
				// Insert all the time, will get current if already there
				objectToNodeMap.Add( obj, node );
				node.AddObject( obj );
			}
			else
			{
				// Find distance to dividing plane
				float dist = node.GetDistance( pos );

				//CHECK: treat obj as bounding box?
				if ( Utility.Abs( dist ) < obj.BoundingRadius )
				{
					// Bounding sphere crosses the plane, do both.
					TagNodesWithObject( node.BackNode, obj, pos );
					TagNodesWithObject( node.FrontNode, obj, pos );
				}
				else if ( dist < 0 )
				{
					// Do back.
					TagNodesWithObject( node.BackNode, obj, pos );
				}
				else
				{
					// Do front.
					TagNodesWithObject( node.FrontNode, obj, pos );
				}
			}
		}