cube: Make a cube

Description Usage Arguments Value See Also Examples

View source: R/cube.R

Description

Make a solid or hollow cube.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
cube(
  xlen = 10,
  ylen = 10,
  zlen = 10,
  blockid = 1,
  styleid = 0,
  fill = FALSE,
  offset = c(0, -1, 0),
  playerid = miner::getPlayerIds(),
  pos,
  xlim,
  ylim,
  zlim
)

Arguments

xlen

integer. Cube length.

ylen

integer. Cube hight.

zlen

integer. Cube depth.

blockid

integer. Block type.

styleid

integer. Block style.

fill

logical. If TRUE then solid. If FALSE then hollow.

offset

vector of length three. How many units to offset the cube from 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 corner of the cube. Defaults to the player's position.

xlim

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

ylim

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

zlim

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

Value

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

See Also

sphere() to create a sphere.

Examples

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

# Stone cube 10x10x10
cube(pos = c(0, 0, 0))

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

# Stone fence
cube(ylim = c(2, 3), offset = c(0, -2, 0))

## End(Not run)

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