Difference between revisions of "PRIM TYPE BOX"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 8: Line 8:


{{#vardefine:caveats|{{#var:caveats}}
{{#vardefine:caveats|{{#var:caveats}}
{{Anchor|z_taper}}{{#switch:{{{2|}}}|all=
* {{Anchor|z_taper}}{{LSL Param|z_taper|top_size}} and client values are different, conversion is required. To convert between PRIM_TYPE and to and from the client format use the following equation <tt>1.0 - value</tt>.
* PRIM_TYPE_BOX, PRIM_TYPE_CYLINDER, PRIM_TYPE_PRISM:
<dl><dd>
**|*}} {{LSL Param|z_taper|top_size}} - the range supported by the client and scripting are not identical (client [-1, 1], script [0, 2]). To convert a value from one range to the other use the following equation <tt>1.0 - value</tt> (the same equation works for going in both direction).
{{{!}} {{Prettytable|style=margin: 0;}}
{{!}}-
{{!}}
!{{Hl2}}{{!}} Range
!{{Hl2}}{{!}} Top<br/>Tapered
!{{Hl2}}{{!}} No <br/>Tapering
!{{Hl2}}{{!}} Bottom<br/>Tapered
{{!}}-
!{{Hl2}}{{!}} Client
{{!}} [-1, 1]
{{!}} 1.0
{{!}} 0.0
{{!}} -1.0
{{!}}-
!{{Hl2}}{{!}} [[#PRIM_TYPE|PRIM_TYPE]]
{{!}} [0, 2]
{{!}} 0.0
{{!}} 1.0
{{!}} 2.0
{{!}}-
!{{Hl2}}{{!}} [[#PRIM_TYPE_LEGACY|LEGACY]]{{Footnote|'''top_size''' - [[#PRIM_TYPE_LEGACY|PRIM_TYPE_LEGACY]]'s range is encompassed in [[#PRIM_TYPE|PRIM_TYPE]]'s.}}
{{!}} [0, 1]
{{!}} 0.0
{{!}} 1.0
{{!}} {{HoverText|NA|The bottom cannot be tapered via PRIM_TYPE_LEGACY.}}
{{!}}}
</dl>
}}
}}



Revision as of 13:49, 16 March 2009

Description

Constant: integer PRIM_TYPE_BOX = 0;

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.

PRIM_TYPE

[ PRIM_TYPE, PRIM_TYPE_BOX, integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
• integer hole_shape PRIM_HOLE_* flag
• vector cut x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)
• float hollow ranges from 0.0 (solid) to 0.95 (maximum hollowed)
• vector twist ranges 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)
• vector top_size ranges from 0.0 to 1.0 to 2.0 for both x and y (z is ignored)!
• vector top_shear ranges from -0.5 to 0.5 for both x and y (z is ignored)
hole_shape Flags Shape hole_shape Flags Shape
PRIM_HOLE_DEFAULT 0x00 Default PRIM_HOLE_SQUARE 0x20 Square
PRIM_HOLE_CIRCLE 0x10 Circle PRIM_HOLE_TRIANGLE 0x30 Triangle

PRIM_TYPE_LEGACY

[ 1, PRIM_TYPE_BOX, vector cut, float hollow, float twist, vector top_size, vector top_shear ]
• vector cut x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)
• float hollow ranges from 0.0 (solid) to 0.95 (maximum hollowed)
• float twist ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window)
• vector top_size ranges from 0.0 to 1.0 for both x and y (z is ignored)!
• vector top_shear ranges 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

  • top_size and client values are different, conversion is required. To convert between PRIM_TYPE and to and from the client format use the following equation 1.0 - value.
Range Top
Tapered
No
Tapering
Bottom
Tapered
Client [-1, 1] 1.0 0.0 -1.0
PRIM_TYPE [0, 2] 0.0 1.0 2.0
LEGACY[1] [0, 1] 0.0 1.0 NA
All Issues ~ Search JIRA for related Bugs

Related Articles

Constants

•  PRIM_TYPE
•  CHANGED_SHAPE

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPrimitiveParams

Events

•  changed

Examples

<lsl>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
                     ]);</lsl>

Deep Notes

Search JIRA for related Issues

Footnotes

  1. ^ top_size - PRIM_TYPE_LEGACY's range is encompassed in PRIM_TYPE's.

Signature

integer PRIM_TYPE_BOX = 0;