示例#1
0
 /// <summary>
 /// Get all elements hit by the ray and toss them to the Executor
 /// </summary>
 /// <param name="ray"></param>
 /// <param name="executor"></param>
 public void get(Ray ray, ISelectionExecutor executor)
 {
     if (m_queryTimer != null)
         m_queryTimer.Watch.Start();
     List<SceneElement> hits = new List<SceneElement>();
     m_octreeVisual.getElements(ray, executor);
     if (m_queryTimer != null)
         m_queryTimer.Watch.Stop();
 }
示例#2
0
 /// <summary>
 /// Get all elements within the BoundingBox and toss them to the Executor
 /// </summary>
 /// <param name="bb">BoundingBox to check against</param>
 /// <param name="executor">SelectionExecutor that handles all hits</param>
 public void getCollisions(BoundingBox bb, ISelectionExecutor executor)
 {
     List<SceneElement> hits = new List<SceneElement>();
     m_octreeCollision.getElements(bb, executor);
 }
示例#3
0
        /// <summary>
        /// Get all elements within the BoundingBox and toss them to the Executor
        /// </summary>
        /// <param name="bb">BoundingBox to check against</param>
        /// <param name="executor">SelectionExecutor that handles all hits</param>
        public void getVisuals(BoundingBox bb, ISelectionExecutor executor)
        {
            if (m_queryTimer != null)
                m_queryTimer.Watch.Start();

            List<SceneElement> hits = new List<SceneElement>();
            m_octreeVisual.getElements(bb, executor);

            if (m_queryTimer != null)
                m_queryTimer.Watch.Stop();
        }
示例#4
0
 public void getElements(Ray ray, ISelectionExecutor executor)
 {
     m_root.getElements(ray, executor);
 }
示例#5
0
 public void getElements(BoundingBox bb, ISelectionExecutor executor)
 {
     m_root.getElements(bb, executor);
 }
示例#6
0
 public void getElements(Ray ray, ISelectionExecutor executor)
 {
     float? intersects = ray.Intersects(BoundingBox);
     if (intersects.HasValue)
     {
         foreach (SceneElement e in m_elements)
         {
             if (ray.Intersects(e.BoundingBox).HasValue)
             {
                 executor.execute(e);
                 if (m_children != null)
                 {
                     foreach (OctreeNode node in m_children)
                     {
                         node.getElements(ray, executor);
                     }
                 }
             }
         }
     }
 }
示例#7
0
 public void getElements(BoundingBox bb, ISelectionExecutor executor)
 {
     ContainmentType t = bb.Contains(BoundingBox);
     if (t == ContainmentType.Contains)
     {
         foreach (SceneElement e in m_elements)
         {
             executor.execute(e);
             if (m_children != null)
             {
                 foreach (OctreeNode node in m_children)
                 {
                     node.getElements(bb, executor);
                 }
             }
         }
     }
     else if (t == ContainmentType.Intersects)
     {
         foreach (SceneElement se in m_elements)
         {
             t = bb.Contains(se.BoundingBox);
             if (t == ContainmentType.Contains || t == ContainmentType.Intersects)
             {
                 executor.execute(se);
             }
         }
         if (m_children != null)
         {
             foreach (OctreeNode node in m_children)
             {
                 node.getElements(bb, executor);
             }
         }
     }
     return;
 }