Exemple #1
0
        private static void VoxelOperationRamp_Implementation(long entityId, MyRampShapeParams shapeParams, OperationType Type)
        {
            m_rampShape.Transformation = shapeParams.Transformation;
            m_rampShape.Boundaries.Max = shapeParams.Box.Max;
            m_rampShape.Boundaries.Min = shapeParams.Box.Min;
            m_rampShape.RampNormal     = shapeParams.RampNormal;
            m_rampShape.RampNormalW    = shapeParams.RampNormalW;

            if (CanPlaceInArea(Type, m_rampShape))
            {
                MyEntity entity;
                MyEntities.TryGetEntityById(entityId, out entity);
                MyVoxelBase voxel = entity as MyVoxelBase;
                if (voxel != null)
                {
                    voxel.BeforeContentChanged = true;
                    MyMultiplayer.RaiseEvent(voxel.RootVoxel, x => x.PerformVoxelOperationRamp_Implementation, shapeParams, Type);
                    var amountChanged = voxel.UpdateVoxelShape(Type, m_rampShape, shapeParams.Material);
                    if (Type == OperationType.Cut || Type == OperationType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                }
            }
        }
Exemple #2
0
        public void RequestVoxelOperationRamp(BoundingBoxD box, Vector3D rampNormal, double rampNormalW, MatrixD Transformation, byte material, OperationType Type)
        {
            BeforeContentChanged = true;
            MyRampShapeParams shapeParams = new MyRampShapeParams();

            shapeParams.Box            = box;
            shapeParams.RampNormal     = rampNormal;
            shapeParams.RampNormalW    = rampNormalW;
            shapeParams.Transformation = Transformation;
            shapeParams.Material       = material;

            MyMultiplayer.RaiseStaticEvent(s => VoxelOperationRamp_Implementation, EntityId, shapeParams, Type);
        }
Exemple #3
0
        private void PerformVoxelOperationRamp_Implementation(MyRampShapeParams shapeParams, OperationType Type)
        {
            m_rampShape.Transformation = shapeParams.Transformation;
            m_rampShape.Boundaries.Max = shapeParams.Box.Max;
            m_rampShape.Boundaries.Min = shapeParams.Box.Min;
            m_rampShape.RampNormal     = shapeParams.RampNormal;
            m_rampShape.RampNormalW    = shapeParams.RampNormalW;

            var amountChanged = UpdateVoxelShape(Type, m_rampShape, shapeParams.Material);

            if (Type == OperationType.Cut || Type == OperationType.Fill)
            {
                MySession.Static.VoxelHandVolumeChanged += amountChanged;
            }
        }
Exemple #4
0
        private void PerformVoxelOperationRamp_Implementation(MyRampShapeParams shapeParams, OperationType Type)
        {
            m_rampShape.Transformation = shapeParams.Transformation;
            m_rampShape.Boundaries.Max = shapeParams.Box.Max;
            m_rampShape.Boundaries.Min = shapeParams.Box.Min;
            m_rampShape.RampNormal = shapeParams.RampNormal;
            m_rampShape.RampNormalW = shapeParams.RampNormalW;

            var amountChanged = UpdateVoxelShape(Type, m_rampShape, shapeParams.Material);
            if (Type == OperationType.Cut || Type == OperationType.Fill)
            {
                MySession.Static.VoxelHandVolumeChanged += amountChanged;
            }
        }
Exemple #5
0
        private static void VoxelOperationRamp_Implementation(long entityId, MyRampShapeParams shapeParams, OperationType Type)
        {
            m_rampShape.Transformation = shapeParams.Transformation;
            m_rampShape.Boundaries.Max = shapeParams.Box.Max;
            m_rampShape.Boundaries.Min = shapeParams.Box.Min;
            m_rampShape.RampNormal = shapeParams.RampNormal;
            m_rampShape.RampNormalW = shapeParams.RampNormalW;

            if (CanPlaceInArea(Type, m_rampShape))
            {
                MyEntity entity;
                MyEntities.TryGetEntityById(entityId, out entity);
                MyVoxelBase voxel = entity as MyVoxelBase;
                if (voxel != null)
                {
                    voxel.BeforeContentChanged = true;
                    MyMultiplayer.RaiseEvent(voxel.RootVoxel, x => x.PerformVoxelOperationRamp_Implementation, shapeParams, Type);
                    var amountChanged = voxel.UpdateVoxelShape(Type, m_rampShape, shapeParams.Material);
                    if (Type == OperationType.Cut || Type == OperationType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                }
            }
        }
Exemple #6
0
        public void RequestVoxelOperationRamp(BoundingBoxD box, Vector3D rampNormal, double rampNormalW, MatrixD Transformation, byte material, OperationType Type)
        {
            BeforeContentChanged = true;
            MyRampShapeParams shapeParams = new MyRampShapeParams();
            shapeParams.Box = box;
            shapeParams.RampNormal = rampNormal;
            shapeParams.RampNormalW = rampNormalW;
            shapeParams.Transformation = Transformation;
            shapeParams.Material = material;

            MyMultiplayer.RaiseStaticEvent(s => VoxelOperationRamp_Implementation, EntityId, shapeParams, Type);
        }