Ejemplo n.º 1
0
 public static void GetTopmostEntitiesOverlappingRay(ref LineD ray, List <MyLineSegmentOverlapResult <MyEntity> > result, MyEntityQueryType qtype = MyEntityQueryType.Both)
 {
     ProfilerShort.Begin("MyGamePruningStructure::GetAllEntitiesInRay");
     if (qtype.HasDynamic())
     {
         m_dynamicObjectsTree.OverlapAllLineSegment <MyEntity>(ref ray, result);
     }
     if (qtype.HasStatic())
     {
         m_staticObjectsTree.OverlapAllLineSegment <MyEntity>(ref ray, result, false);
     }
     ProfilerShort.End();
 }
Ejemplo n.º 2
0
 public static void GetAllTopMostEntitiesInSphere(ref BoundingSphereD sphere, List <MyEntity> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
 {
     VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllTopMostEntitiesInSphere");
     if (qtype.HasDynamic())
     {
         m_dynamicObjectsTree.OverlapAllBoundingSphere <MyEntity>(ref sphere, result, false);
     }
     if (qtype.HasStatic())
     {
         m_staticObjectsTree.OverlapAllBoundingSphere <MyEntity>(ref sphere, result, false);
     }
     VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
 }
Ejemplo n.º 3
0
        public static void GetAllEntitiesInRay(ref LineD ray, List <MyLineSegmentOverlapResult <MyEntity> > result, MyEntityQueryType qtype = MyEntityQueryType.Both)
        {
            VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllEntitiesInRay");
            if (qtype.HasDynamic())
            {
                m_dynamicObjectsTree.OverlapAllLineSegment <MyEntity>(ref ray, result);
            }
            if (qtype.HasStatic())
            {
                m_staticObjectsTree.OverlapAllLineSegment <MyEntity>(ref ray, result, false);
            }
            int topmostCount = result.Count;

            for (int i = 0; i < topmostCount; i++)
            {
                if (result[i].Element.Hierarchy != null)
                {
                    result[i].Element.Hierarchy.QueryLine(ref ray, result);
                }
            }
            VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
        }
Ejemplo n.º 4
0
        public static void GetAllEntitiesInSphere(ref BoundingSphereD sphere, List <MyEntity> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
        {
            VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllEntitiesInSphere");

            if (qtype.HasDynamic())
            {
                m_dynamicObjectsTree.OverlapAllBoundingSphere <MyEntity>(ref sphere, result, false);
            }
            if (qtype.HasStatic())
            {
                m_staticObjectsTree.OverlapAllBoundingSphere <MyEntity>(ref sphere, result, false);
            }
            int topmostCount = result.Count;

            for (int i = 0; i < topmostCount; i++)
            {
                if (result[i].Hierarchy != null)
                {
                    result[i].Hierarchy.QuerySphere(ref sphere, result);
                }
            }
            VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
        }
 public static void GetTopmostEntitiesOverlappingRay(ref LineD ray, List<MyLineSegmentOverlapResult<MyEntity>> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
 {
     ProfilerShort.Begin("MyGamePruningStructure::GetAllEntitiesInRay");
     if (qtype.HasDynamic())
         m_dynamicObjectsTree.OverlapAllLineSegment<MyEntity>(ref ray, result);
     if (qtype.HasStatic())
         m_staticObjectsTree.OverlapAllLineSegment<MyEntity>(ref ray, result, false);
     ProfilerShort.End();
 }
 public static void GetAllEntitiesInRay(ref LineD ray, List<MyLineSegmentOverlapResult<MyEntity>> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
 {
     VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllEntitiesInRay");
     if (qtype.HasDynamic())
     m_dynamicObjectsTree.OverlapAllLineSegment<MyEntity>(ref ray, result);
     if (qtype.HasStatic())
     m_staticObjectsTree.OverlapAllLineSegment<MyEntity>(ref ray, result, false);
     int topmostCount = result.Count;
     for (int i = 0; i < topmostCount; i++)
     {
         if (result[i].Element.Hierarchy != null)
             result[i].Element.Hierarchy.QueryLine(ref ray, result);
     }
     VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
 }
        public static void GetAllTargetsInSphere(ref BoundingSphereD sphere, List<MyEntity> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
        {
            VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllTargetsInSphere");

            if (qtype.HasDynamic())
            m_dynamicObjectsTree.OverlapAllBoundingSphere<MyEntity>(ref sphere, result, false);
            if (qtype.HasStatic())
            m_staticObjectsTree.OverlapAllBoundingSphere<MyEntity>(ref sphere, result, false);
            int topmostCount = result.Count;
            for (int i = 0; i < topmostCount; i++)
            {
                if (result[i].Hierarchy != null)
                    result[i].Hierarchy.QuerySphere(ref sphere, result);
            }

            VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
        }
 public static void GetAllTopMostEntitiesInSphere(ref BoundingSphereD sphere, List<MyEntity> result, MyEntityQueryType qtype = MyEntityQueryType.Both)
 {
     VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyGamePruningStructure::GetAllTopMostEntitiesInSphere");
     if (qtype.HasDynamic())
     m_dynamicObjectsTree.OverlapAllBoundingSphere<MyEntity>(ref sphere, result, false);
     if (qtype.HasStatic())
     m_staticObjectsTree.OverlapAllBoundingSphere<MyEntity>(ref sphere, result, false);
     VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock();
 }