The integer constant PRIM_TYPE_BOX has the value 0

PRIM_TYPE_BOX is a parameter of PRIM_TYPE used to make prim into a box and to change specific properties that define the shape of that box.

Syntax

integer PRIM_TYPE_BOX = 0;

Usage

[ PRIM_TYPE, PRIM_TYPE_BOX, integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]

integerhole_shapePRIM_HOLE_* flag
vectorcutx and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)
floathollowranges from 0.0 (solid) to 0.95 (maximum hollowed)
vectortwistranges from -1.0 (-180 degree in the edit window) to 1.0 (+180 degree in the edit window) for both x and y (z is ignored)
vectortop_sizeranges from 0.0 to 1.0 to 2.0 for both x and y (z is ignored)!
vectortop_shearranges from -0.5 to 0.5 for both x and y (z is ignored)
hole_shape FlagsShapehole_shape FlagsShape
PRIM_HOLE_DEFAULT0x00DefaultPRIM_HOLE_SQUARE0x20Square
PRIM_HOLE_CIRCLE0x10CirclePRIM_HOLE_TRIANGLE0x30Triangle

[ 1, PRIM_TYPE_BOX, vector cut, float hollow, float twist, vector top_size, vector top_shear ]

vectorcutx and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)
floathollowranges from 0.0 (solid) to 0.95 (maximum hollowed)
floattwistranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window)
vectortop_sizeranges from 0.0 to 1.0 for both x and y (z is ignored)!
vectortop_shearranges from -0.5 to 0.5 for both x and y (z is ignored)

This is the old PRIM_TYPE format for boxes (PRIM_TYPE used to be 1 instead of 9). Use the new format unless you are maintaining old code.

Caveats

Examples

llSetPrimitiveParams([PRIM_TYPE, 
                        PRIM_TYPE_BOX, 
                            PRIM_HOLE_DEFAULT,  // hole_shape
                            <0.00, 1.0, 0.0>,   // cut
                            0.0,                // hollow
                            <0.0, 0.0, 0.0>,    // twist
                            <1.0, 1.0, 0.0>,    // top_size
                            <0.0, 0.0, 0.0>     // top_Shear
                      ]);

See also

Constants

Functions

Events

Deep notes

PRIM_TYPE top_size and client taper conversion

RangeTop
Tapered
No
Tapering
Bottom
Tapered
Client≥ -1, ≤ 11.00.0-1.0
PRIM_TYPE≥ 0, ≤ 20.01.02.0
LEGACY≥ 0, ≤ 10.01.0NA
Client < 1.11≥ 0, ≤ 10.01.0NA

top_size Explained

When the original PRIM_TYPE interface was retired (PRIM_TYPE_LEGACY, SL 1.5), the new PRIM_TYPE interface did not yet support tapering of the bottom of the prim, this feature wasn't added until SL 1.11 (two years later). Instead of retiring the new PRIM_TYPE when it was added, the range of top_size was enlarged; meanwhile in the client they redefined the parameter and it's values. This redefinition and range enlargement resulted in two interfaces that did the same thing but achieved it through different values. Meanwhile PRIM_TYPE_LEGACY's interface was not updated to support tapering of the bottom of the prim. Consequently all three interfaces have different ranges, making for a rather nasty caveat.