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); }
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; } } }
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); } } }
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); } } }
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; } }
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); }