コード例 #1
0
        public void RequestVoxelPaintRamp(BoundingBoxD box, Vector3D rampNormal, double rampNormalW, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintRampMessage();

            msg.EntityId       = Entity.EntityId;
            msg.Min            = box.Min;
            msg.Max            = box.Max;
            msg.RampNormal     = rampNormal;
            msg.RampNormalW    = rampNormalW;
            msg.Type           = Type;
            msg.Material       = material;
            msg.Transformation = Transformation;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
コード例 #2
0
        static void VoxelPaintRampSuccess(MySyncVoxel sync, ref PaintRampMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_rampShape.Transformation = msg.Transformation;
                m_rampShape.Boundaries.Max = msg.Max;
                m_rampShape.Boundaries.Min = msg.Min;
                m_rampShape.RampNormal     = msg.RampNormal;
                m_rampShape.RampNormalW    = msg.RampNormalW;
                var amountChanged = UpdateVoxelShape(sync, msg.Type, m_rampShape, msg.Material);
                if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                {
                    MySession.Static.VoxelHandVolumeChanged += amountChanged;
                }
            }
        }
コード例 #3
0
        static void VoxelPaintRampRequest(MySyncVoxel sync, ref PaintRampMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_rampShape.Transformation = msg.Transformation;
                m_rampShape.Boundaries.Max = msg.Max;
                m_rampShape.Boundaries.Min = msg.Min;
                m_rampShape.RampNormal     = msg.RampNormal;
                m_rampShape.RampNormalW    = msg.RampNormalW;

                if (CanPlaceInArea(msg.Type, m_rampShape))
                {
                    var amountChanged = UpdateVoxelShape(sync, msg.Type, m_rampShape, msg.Material);
                    if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
コード例 #4
0
ファイル: MySyncVoxel.cs プロジェクト: Krulac/SpaceEngineers
 static void VoxelPaintRampRequest(MySyncVoxel sync, ref PaintRampMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_rampShape.Transformation = msg.Transformation;
         m_rampShape.Boundaries.Max = msg.Max;
         m_rampShape.Boundaries.Min = msg.Min;
         m_rampShape.RampNormal = msg.RampNormal;
         m_rampShape.RampNormalW = msg.RampNormalW;
         
         if (CanPlaceInArea(msg.Type, m_rampShape))
         {
             var amountChanged = UpdateVoxelShape(sync, msg.Type, m_rampShape, msg.Material);
             if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                 MySession.Static.VoxelHandVolumeChanged += amountChanged;
             Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
         }
     }
 }
コード例 #5
0
ファイル: MySyncVoxel.cs プロジェクト: Krulac/SpaceEngineers
 static void VoxelPaintRampSuccess(MySyncVoxel sync, ref PaintRampMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_rampShape.Transformation = msg.Transformation;
         m_rampShape.Boundaries.Max = msg.Max;
         m_rampShape.Boundaries.Min = msg.Min;
         m_rampShape.RampNormal = msg.RampNormal;
         m_rampShape.RampNormalW = msg.RampNormalW;
         var amountChanged = UpdateVoxelShape(sync, msg.Type, m_rampShape, msg.Material);
         if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
             MySession.Static.VoxelHandVolumeChanged += amountChanged;
     }
 }
コード例 #6
0
ファイル: MySyncVoxel.cs プロジェクト: Krulac/SpaceEngineers
        public void RequestVoxelPaintRamp(BoundingBoxD box, Vector3D rampNormal,double rampNormalW, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintRampMessage();
            msg.EntityId = Entity.EntityId;
            msg.Min = box.Min;
            msg.Max = box.Max;
            msg.RampNormal = rampNormal;
            msg.RampNormalW = rampNormalW;
            msg.Type = Type;
            msg.Material = material;
            msg.Transformation = Transformation;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }