Box

Box

An axis-aligned rectangular prism defined by a center point and x-, y- and z-extents (radii)
from that center (a box).

Constructor

new Box(widthopt, heightopt, lengthopt, tileXopt, tileYopt, textureModeopt)

Parameters:
Name Type Attributes Default Description
width number <optional>
1

Total width of box.

height number <optional>
1

Total height of box.

length number <optional>
1

Total length of box.

tileX number <optional>
1

Number of texture repetitions in the texture's x direction.

tileY number <optional>
1

Number of texture repetitions in the texture's y direction.

textureMode Enum <optional>
Box.TextureModes.Uniform

Texture wrapping mode.

Members

(static) TextureModes :Object

Possible texture wrapping modes: Uniform, Unfolded

textureMode :Enum

Texture wrapping mode.

Default Value:
  • Box.TextureModes.Uniform

tileX :number

Number of texture repetitions in the texture's x direction.

Default Value:
  • 1

tileY :number

Number of texture repetitions in the texture's y direction.

Default Value:
  • 1

xExtent :number

Extent along the local x axis.

Default Value:
  • 0.5

yExtent :number

Extent along the local y axis.

Default Value:
  • 0.5

zExtent :number

Extent along the local z axis.

Default Value:
  • 0.5

Methods

clone() → {Box}

Returns a clone of this box

rebuild() → {Box}

Builds or rebuilds the mesh data.