コード例 #1
0
ファイル: gbxmodel.cs プロジェクト: p0lar-bear/Prometheus
        public Instance GetPermutation(int[] permutations)
        {
            if (instances == null)
            {
                instances = new InstanceCollection();
            }
            else
            {
                instances.Clear();
            }

            for (int i = 0; i < gbxmodelValues.Regions.Count; i++)
            {
                switch (lod)
                {
                case LevelOfDetail.SuperLow:
                    for (int j = 0; j < superLow[i][permutations[i]].Count; j++)
                    {
                        instances.Add(superLow[i][permutations[i]][j]);
                    }
                    break;

                case LevelOfDetail.Low:
                    for (int j = 0; j < low[i][permutations[i]].Count; j++)
                    {
                        instances.Add(low[i][permutations[i]][j]);
                    }
                    break;

                case LevelOfDetail.Medium:
                    for (int j = 0; j < medium[i][permutations[i]].Count; j++)
                    {
                        instances.Add(medium[i][permutations[i]][j]);
                    }
                    break;

                case LevelOfDetail.High:
                    for (int j = 0; j < high[i][permutations[i]].Count; j++)
                    {
                        instances.Add(high[i][permutations[i]][j]);
                    }
                    break;

                case LevelOfDetail.SuperHigh:
                    for (int j = 0; j < superHigh[i][permutations[i]].Count; j++)
                    {
                        instances.Add(superHigh[i][permutations[i]][j]);
                    }
                    break;
                }
            }

            return(instances);
        }
コード例 #2
0
ファイル: ScenarioBase.cs プロジェクト: p0lar-bear/Prometheus
        /// <summary>
        ///
        /// </summary>
        /// <param name="mouseX"></param>
        /// <param name="mouseY"></param>
        public virtual void SelectionEdit_MouseUp(int mouseX, int mouseY)
        {
            Vector3 PickRayDirection;
            Vector3 PickRayOrigin;

            MdxRender.CalculatePickRayWorld(mouseX, mouseY, out PickRayDirection, out PickRayOrigin);

            #region 2D Selection Box

            /*
             * //see if we need to do a 2D select box
             * multiSelectBox.MouseUp(mouseX, mouseY);
             * if (multiSelectBox.Mode != MultiSelectMode.Disabled)
             * {
             * if (multiSelectBox.Mode != MultiSelectMode.Disabled)
             * {
             *  ArrayList tmp = multiSelectBox.UpdateFrustumSelection(this);
             *  bool bFoundDuplicate = false;
             *  Instance3D inst, tmp_inst;
             *  //add 2d select box selection list to master selection list
             *  for (int s = 0; s < tmp.Count; s++)
             *  {
             *    tmp_inst = (Instance3D)tmp[s];
             *    //check for duplication
             *    for (int k = 0; k < selectionList.Count; k++)
             *    {
             *      inst = (Instance3D)selectionList[k];
             *      if (tmp_inst == inst)
             *      {
             *        bFoundDuplicate = true;
             *        break;
             *      }
             *    }
             *
             *    if (bFoundDuplicate == false)
             *      selectionList.Add(tmp[s]);
             *  }
             * }
             * }
             * */
            #endregion

            //debug code
            if (activeSelection == null)
            {
                foreach (WorldInstance instance in instances)
                {
                    if (instance.MouseUp(PickRayOrigin, PickRayDirection))
                    {
                        activeSelection = instance;
                    }
                }

                if ((selectionList.Count != 0) && (multiSelectBox.Mode == MultiSelectMode.Disabled))
                {
                    foreach (WorldInstance item in instances)
                    {
                        item.Selected = false;
                    }

                    selectionList.Clear();
                }
                //if(m_DebugObject1.MouseUp(PickRayOrigin, PickRayDirection, false))
                //  m_ActiveSelection = m_DebugObject1;
            }
            else
            {
                activeSelection.MakeEditInactive();
                if (activeSelection.MouseUp(PickRayOrigin, PickRayDirection) == false)
                {
                    if (activeSelection.EditMode == EditMode.NotSelected)
                    {
                        activeSelection = null;
                    }
                }
            }

            UpdateSelectionLeader();
        }