public override void RegenSelectionBoxes(IPlayer byPlayer) { // Create a temporary array first, because the offthread particle system might otherwise access a null collisionbox Cuboidf[] selectionBoxesTmp = new Cuboidf[VoxelCuboids.Count]; CuboidWithMaterial cwm = tmpCuboids[0]; totalVoxels = 0; for (int i = 0; i < VoxelCuboids.Count; i++) { FromUint(VoxelCuboids[i], cwm); selectionBoxesTmp[i] = cwm.ToCuboidf(); totalVoxels += cwm.Volume; } selectionBoxes = selectionBoxesTmp; if (byPlayer != null) { RegenSelectionVoxelBoxes(false, byPlayer); } else { selectionBoxesVoxels = null; } }
public virtual void RegenSelectionBoxes(IPlayer byPlayer) { // Create a temporary array first, because the offthread particle system might otherwise access a null collisionbox Cuboidf[] selectionBoxesTmp = new Cuboidf[VoxelCuboids.Count]; CuboidWithMaterial cwm = tmpCuboid; for (int i = 0; i < VoxelCuboids.Count; i++) { FromUint(VoxelCuboids[i], cwm); selectionBoxesTmp[i] = cwm.ToCuboidf(); } this.selectionBoxes = selectionBoxesTmp; }
public void RegenSelectionBoxes(IPlayer byPlayer) { selectionBoxes = new Cuboidf[VoxelCuboids.Count]; for (int i = 0; i < VoxelCuboids.Count; i++) { FromUint(VoxelCuboids[i], ref tmpCuboid); selectionBoxes[i] = tmpCuboid.ToCuboidf(); } if (byPlayer != null) { RegenSelectionVoxelBoxes(false, byPlayer); } else { selectionBoxesVoxels = null; } }