コード例 #1
0
        private MyBrushCapsule()
        {
            m_shape = new MyShapeCapsule();
            m_transform = MatrixD.Identity;

            m_radius = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.First, MyCommonTexts.VoxelHandProperty_Capsule_Radius
            );
            m_radius.ValueChanged += RecomputeShape;

            m_length = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Second, MyCommonTexts.VoxelHandProperty_Capsule_Length
            );
            m_length.ValueChanged += RecomputeShape;

            m_list = new List<MyGuiControlBase>();
            m_radius.AddControlsToList(m_list);
            m_length.AddControlsToList(m_list);

            RecomputeShape();
        }
コード例 #2
0
        private MyBrushBox()
        {
            m_shape = new MyShapeBox();
            m_transform = MatrixD.Identity;

            m_width = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.First, MyCommonTexts.VoxelHandProperty_Box_Width
            );
            m_width.ValueChanged += RecomputeShape;

            m_height = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Second, MyCommonTexts.VoxelHandProperty_Box_Height
            );
            m_height.ValueChanged += RecomputeShape;

            m_depth = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Third, MyCommonTexts.VoxelHandProperty_Box_Depth
            );
            m_depth.ValueChanged += RecomputeShape;

            m_list = new List<MyGuiControlBase>();
            m_width.AddControlsToList(m_list);
            m_height.AddControlsToList(m_list);
            m_depth.AddControlsToList(m_list);

            RecomputeShape();
        }
コード例 #3
0
        private MyBrushEllipsoid()
        {
            m_shape = new MyShapeEllipsoid();
            m_transform = MatrixD.Identity;

            float step = MySessionComponentVoxelHand.VOXEL_SIZE / 4;

            m_radiusX = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale, step,
                MyVoxelBrushGUIPropertyOrder.First, MyStringId.GetOrCompute("Radius X")
            );
            m_radiusX.ValueChanged += RadiusChanged;

            m_radiusY = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale, step,
                MyVoxelBrushGUIPropertyOrder.Second, MyStringId.GetOrCompute("Radius Y")
            );
            m_radiusY.ValueChanged += RadiusChanged;

            m_radiusZ = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale, step,
                MyVoxelBrushGUIPropertyOrder.Third, MyStringId.GetOrCompute("Radius Z")
            );
            m_radiusZ.ValueChanged += RadiusChanged;

            m_list = new List<MyGuiControlBase>();
            m_radiusX.AddControlsToList(m_list);
            m_radiusY.AddControlsToList(m_list);
            m_radiusZ.AddControlsToList(m_list);

            RecomputeShape();
        }
コード例 #4
0
        private MyBrushAutoLevel()
        {
            m_shape = new MyShapeBox();
            m_transform = MatrixD.Identity;

            m_axis = new MyBrushGUIPropertyNumberCombo(
                MyVoxelBrushGUIPropertyOrder.First, MyCommonTexts.VoxelHandProperty_AutoLevel_Axis
            );
            m_axis.AddItem(X_ASIS, MyCommonTexts.VoxelHandProperty_AutoLevel_AxisX);
            m_axis.AddItem(Y_ASIS, MyCommonTexts.VoxelHandProperty_AutoLevel_AxisY);
            m_axis.AddItem(Z_ASIS, MyCommonTexts.VoxelHandProperty_AutoLevel_AxisZ);
            m_axis.SelectItem(Y_ASIS);

            m_area = new MyBrushGUIPropertyNumberSlider(
                MinScale*2f, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Second, MyCommonTexts.VoxelHandProperty_AutoLevel_Area
            );
            m_area.ValueChanged += RecomputeShape;

            m_height = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Third, MyCommonTexts.VoxelHandProperty_Box_Height
            );
            m_height.ValueChanged += RecomputeShape;

            m_list = new List<MyGuiControlBase>();
            m_axis.AddControlsToList(m_list);
            m_area.AddControlsToList(m_list);
            m_height.AddControlsToList(m_list);

            RecomputeShape();
        }
コード例 #5
0
        private MyBrushSphere()
        {
            m_shape = new MyShapeSphere();
            m_shape.Radius = MinScale;
            m_transform = MatrixD.Identity;

            m_radius = new MyBrushGUIPropertyNumberSlider(
                m_shape.Radius, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.First, MyCommonTexts.VoxelHandProperty_Sphere_Radius
            );
            m_radius.ValueChanged += RadiusChanged;

            m_list = new List<MyGuiControlBase>();
            m_radius.AddControlsToList(m_list);
        }