/// <summary> /// Add objects into the quad tree /// </summary> /// <param name="obj"></param> public void AddSceneBlockObject(ISceneObject obj) { if (!m_IsInitialized) { return; } if (m_QuadTree == null) { return; } if (obj == null) { return; } SceneObject sbobj = new SceneObject(obj); m_QuadTree.Add(sbobj); // Create the object if (m_CurrentDetector != null && m_CurrentDetector.IsDetected(sbobj.Bounds)) { // add to the object loaded list m_LoadedObjectList.Add(sbobj); // create the object CreateObject(sbobj); } }
/// <summary> /// 添加场景物体 /// </summary> /// <param name="obj"></param> public void AddSceneBlockObject(ISceneObject obj) { if (!m_IsInitialized) { return; } if (m_QuadTree == null) { return; } if (obj == null) { return; } //使用SceneObject包装 SceneObject sbobj = new SceneObject(obj); m_QuadTree.Add(sbobj); //如果当前触发器存在,直接物体是否可触发,如果可触发,则创建物体 if (m_CurrentDetector != null && m_CurrentDetector.IsDetected(sbobj.Bounds)) { DoCreateInternal(sbobj); } }