void OnCutOut(ref MyEventCutOut msg) { MyVoxelMap voxelMap; if (MyEntities.TryGetEntityById<MyVoxelMap>(msg.VoxelMapEntityId.ToEntityId(), out voxelMap)) { var sphere = new BoundingSphere(msg.Position, msg.Radius); //remove decals MyDecals.HideTrianglesAfterExplosion(voxelMap, ref sphere); //cut off MyVoxelGenerator.CutOutSphereFast(voxelMap, sphere); } }
public void CutOut(MyVoxelMap voxelMap, ref BoundingSphere cutOutSphere) { Debug.Assert(voxelMap.EntityId.HasValue); var msg = new MyEventCutOut(); msg.Position = cutOutSphere.Center; msg.Radius = cutOutSphere.Radius; msg.VoxelMapEntityId = voxelMap.EntityId.Value.NumericValue; Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered, 0); }