示例#1
0
        public void RequestVoxelPaintCapsule(Vector3D A, Vector3D B, float radius, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintCapsuleMessage();

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

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
示例#2
0
        static void VoxelPaintCapsuleSuccess(MySyncVoxel sync, ref PaintCapsuleMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_capsuleShape.Transformation = msg.Transformation;
                m_capsuleShape.A      = msg.A;
                m_capsuleShape.B      = msg.B;
                m_capsuleShape.Radius = msg.Radius;
                var amountChanged = UpdateVoxelShape(sync, msg.Type, m_capsuleShape, msg.Material);
                if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                {
                    MySession.Static.VoxelHandVolumeChanged += amountChanged;
                }
            }
        }
示例#3
0
        static void VoxelPaintCapsuleRequest(MySyncVoxel sync, ref PaintCapsuleMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_capsuleShape.Transformation = msg.Transformation;
                m_capsuleShape.A      = msg.A;
                m_capsuleShape.B      = msg.B;
                m_capsuleShape.Radius = msg.Radius;
                if (CanPlaceInArea(msg.Type, m_capsuleShape))
                {
                    var amountChanged = UpdateVoxelShape(sync, msg.Type, m_capsuleShape, msg.Material);
                    if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
示例#4
0
 static void VoxelPaintCapsuleRequest(MySyncVoxel sync, ref PaintCapsuleMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_capsuleShape.Transformation = msg.Transformation;
         m_capsuleShape.A = msg.A;
         m_capsuleShape.B = msg.B;
         m_capsuleShape.Radius = msg.Radius;
         if (CanPlaceInArea(msg.Type, m_capsuleShape))
         {
             var amountChanged = UpdateVoxelShape(sync, msg.Type, m_capsuleShape, msg.Material);
             if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                 MySession.Static.VoxelHandVolumeChanged += amountChanged;
             Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
         }
     }
 }
示例#5
0
 static void VoxelPaintCapsuleSuccess(MySyncVoxel sync, ref PaintCapsuleMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_capsuleShape.Transformation = msg.Transformation;
         m_capsuleShape.A = msg.A;
         m_capsuleShape.B = msg.B;
         m_capsuleShape.Radius = msg.Radius;
         var amountChanged = UpdateVoxelShape(sync, msg.Type, m_capsuleShape, msg.Material);
         if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
             MySession.Static.VoxelHandVolumeChanged += amountChanged;
     }
 }
示例#6
0
        public void RequestVoxelPaintCapsule(Vector3D A, Vector3D B,float radius, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintCapsuleMessage();
            msg.EntityId = Entity.EntityId;
            msg.A = A;
            msg.B = B;
            msg.Radius = radius;
            msg.Type = Type;
            msg.Material = material;
            msg.Transformation = Transformation;

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