sphere: Make a sphere

Description Usage Arguments Value See Also Examples

View source: R/sphere.R

Description

Make a solid or hollow sphere with the player at the center.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sphere(
  radius = 15,
  blockid = 20,
  styleid = 0,
  fill = FALSE,
  offset = c(0, 0, 0),
  playerid = miner::getPlayerIds(),
  pos,
  xlim,
  ylim,
  zlim
)

Arguments

radius

integer. Specifies the radius of the sphere.

blockid

integer. Block type to be used.

styleid

integer. Block style to be used.

fill

logical. Should the sphere be solid or hollow. Defaults to hollow.

offset

vector of length three. Defines where to place the sphere with respect to pos.

playerid

integer of length one. Defaults to player id in solo play. Set explicitly in multi play.

pos

vector of length three. Defines the center of the sphere. Defaults to the player id position.

xlim

vector of length two. Defines the lower and upper cuttoff points to truncate the sphere.

ylim

vector of length two. Defines the lower and upper cuttoff points to truncate the sphere.

zlim

vector of length two. Defines the lower and upper cuttoff points to truncate the sphere.

Value

Builds a sphere (or a truncated sphere) around the players current position. By default, the sphere is hollow, but you can also use fill=TRUE to create a solid sphere. The players position is determined by miner::getPlayerPos(). You can you can reposition the sphere with the offset command. Use xlim, ylim, zlim to truncate the sphere. This function will return the sphere's origin.

See Also

cube() to create a cube.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 

# Hollow glass sphere of size 15
sphere(pos = c(0, 0, 0))

# Erase sphere
sphere(blockid = 0, pos = c(0, 0, 0))

# Glass dome
sphere(ylim = c(0, 15))

## End(Not run)

ropenscilabs/miner.extra documentation built on Dec. 20, 2020, 1:25 p.m.