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