public static void Draw()
        {
            if (m_Enabled && IsAnyEditorActive())
            {
                VoxelHandShape.Draw();
                if (MyVoxelConstants.VOXEL_HAND_DRAW_CONE && !MyFakes.MWBUILDER)
                {
                    VoxelHandShape.DrawCone(m_conePosition);
                }

                if (MyEditor.DisplayVoxelBounding)
                {
                    foreach (MyEntity voxelMapEntity in MyVoxelMaps.GetVoxelMaps())
                    {
                        MyVoxelMap voxelMap = voxelMapEntity as MyVoxelMap;
                        voxelMap.DrawBounding();
                    }
                }

                if (MyFakes.MWBUILDER)
                {
                    Matrix  wm  = VoxelHandShape.WorldMatrix;
                    Vector4 clr = Vector4.One;
                    MySimpleObjectDraw.DrawTransparentSphere(ref wm, 10, ref clr, false, 8);

                    MyDebugDraw.TextBatch.AddText(wm.Translation, new System.Text.StringBuilder(MyUtils.GetFormatedVector3(wm.Translation, 0)), Color.White, 0.8f);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// DrawSelectedBounding
        /// </summary>
        private void DrawSelectedBounding()
        {
            if (MyConfig.EditorDisplayUnselectedBounding)
            {
                Vector4 color = new Vector4(0.6f, 0.6f, 0.6f, 0.2f);
                foreach (MyEntity entity in MyEntities.GetEntities())
                {
                    entity.DebugDrawBox(color, false);
                }

                foreach (MyVoxelMap voxelMap in MyVoxelMaps.GetVoxelMaps())
                {
                    MyDebugDraw.DrawHiresBoxWireframe(Matrix.CreateScale(voxelMap.GetSize()) * voxelMap.WorldMatrix, new Vector3(0, 0.4f, 0), 0.3f);
                }
            }

            if (IsEditingPrefabContainer())
            {
                m_activePrefabContainer.DebugDrawBox(new Vector4(1, 1, 0, 0.4f));
            }

            foreach (MyEntity entity in MyEditorGizmo.SelectedEntities)
            {
                if (entity is MyPrefabContainer)
                {
                    MyPrefabContainer container = (MyPrefabContainer)entity;
                    container.DebugDrawBox(new Vector4(0, 1, 0, 0.4f));
                }
            }
        }