Beispiel #1
0
        public void RequestVoxelPaintEllipsoid(Vector3 radius, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintEllipsoidMessage();

            msg.EntityId       = Entity.EntityId;
            msg.Radius         = radius;
            msg.Type           = Type;
            msg.Material       = material;
            msg.Transformation = Transformation;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Beispiel #2
0
        static void VoxelPaintEllipsoidSuccess(MySyncVoxel sync, ref PaintEllipsoidMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelMap;

            if (voxel != null)
            {
                m_ellipsoidShape.Transformation = msg.Transformation;
                m_ellipsoidShape.Radius         = msg.Radius;
                var amountChanged = UpdateVoxelShape(sync, msg.Type, m_ellipsoidShape, msg.Material);
                if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                {
                    MySession.Static.VoxelHandVolumeChanged += amountChanged;
                }
            }
        }
Beispiel #3
0
        static void VoxelPaintEllipsoidRequest(MySyncVoxel sync, ref PaintEllipsoidMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelMap;

            if (voxel != null)
            {
                m_ellipsoidShape.Transformation = msg.Transformation;
                m_ellipsoidShape.Radius         = msg.Radius;
                if (CanPlaceInArea(msg.Type, m_ellipsoidShape))
                {
                    var amountChanged = UpdateVoxelShape(sync, msg.Type, m_ellipsoidShape, msg.Material);
                    if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
Beispiel #4
0
 static void VoxelPaintEllipsoidRequest(MySyncVoxel sync, ref PaintEllipsoidMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelMap;
     if (voxel != null)
     {
         m_ellipsoidShape.Transformation = msg.Transformation;
         m_ellipsoidShape.Radius = msg.Radius;
         if (CanPlaceInArea(msg.Type, m_ellipsoidShape))
         {
             var amountChanged = UpdateVoxelShape(sync, msg.Type, m_ellipsoidShape, msg.Material);
             if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                 MySession.Static.VoxelHandVolumeChanged += amountChanged;
             Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
         }
     }
 }
Beispiel #5
0
 static void VoxelPaintEllipsoidSuccess(MySyncVoxel sync, ref PaintEllipsoidMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelMap;
     if (voxel != null)
     {
         m_ellipsoidShape.Transformation = msg.Transformation;
         m_ellipsoidShape.Radius = msg.Radius;
         var amountChanged = UpdateVoxelShape(sync, msg.Type, m_ellipsoidShape, msg.Material);
         if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
             MySession.Static.VoxelHandVolumeChanged += amountChanged;
     }
 }
Beispiel #6
0
        public void RequestVoxelPaintEllipsoid(Vector3 radius, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintEllipsoidMessage();
            msg.EntityId = Entity.EntityId;
            msg.Radius = radius;
            msg.Type = Type;
            msg.Material = material;
            msg.Transformation = Transformation;

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