Difference between revisions of "PRIM TYPE TORUS"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{#if: {{LSL_Constants/PrimitiveParams}} }}{{LSL Constant |name=PRIM_TYPE_TORUS |type=integer |value=4 |desc= |examples= |constants= {{LSL ConstRow|PRIM_TYPE}} {{LSL ConstRow|CHANGED_SHAPE...)
 
m (<lsl> tag to <source>)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{#if:
{{#if:
{{LSL_Constants/PrimitiveParams}}
{{:PRIM_TYPE}}
}}{{LSL Constant
}}{{LSL Constant
|name=PRIM_TYPE_TORUS
|name=PRIM_TYPE_TORUS
|type=integer
|type=integer
|value=4
|value=4
|desc=
|desc=PRIM_TYPE_TORUS is a parameter of [[PRIM_TYPE]] used to make prim into a torus and to change specific properties that define the shape of that torus.
|pa={{LSL Constant/List|i_front=[ {{LSL_Const|PRIM_TYPE|integer|9}}, [[PRIM_TYPE_TORUS]],&#32;|i_end=&nbsp;]
|text={{LSL_Constants/PrimitiveParams/hole_shape}}
|i1_type=integer|i1_name=hole_shape
|i2_type=vector|i2_name=cut
|i3_type=float|i3_name=hollow
|i4_type=vector|i4_name=twist_torus|i4_disp=twist
|i5_type=vector|i5_name=hole_size
|i6_type=vector|i6_name=top_shear
|i7_type=vector|i7_name=cut|i7_disp=advanced_cut
|i8_type=vector|i8_name=taper
|i9_type=float|i9_name=revolutions
|i10_type=float|i10_name=radius_offset
|i11_type=float|i11_name=skew
|toc=PRIM_TYPE
}}
|pb={{LSL Constant/List|i_front=[ 1, [[PRIM_TYPE_TORUS]],&#32;|i_end=&nbsp;]
|text=This is the old PRIM_TYPE format for the torus (PRIM_TYPE used to be 1 instead of 9). Use the new format unless you are maintaining old code.
|i1_type=vector|i1_name=cut
|i2_type=float|i2_name=hollow
|i3_type=float|i3_name=twist_end
|i4_type=float|i4_name=hole_size_y
|i5_type=vector|i5_name=top_shear
|i6_type=vector|i6_name=cut|i6_disp=advanced_cut
|toc=PRIM_TYPE_LEGACY
}}
|examples=
|examples=
<source lang="lsl2">// this makes a nice expanding spiral
vector cut= <0.00000, 1.00000, 0.00000>;
float hollow = 0.0;                    // 0.0 to 0.95
vector twist = <0, 0.0, 0.0>;          // -1.0 to 1.0
vector holesize = <1.0, 0.05, 0.0>;    // max X:1.0 Y:0.5
vector topshear = <0.0, 0.0, 0.0>;    // -0.5 to 0.5
vector profilecut = <0.0, 0.0, 0.0>;  // 0.0 to 1.0
vector taper_a = <0.0, 0.0, 0.0>;      // 0.0 to 1.0
float revolutions = 3.0;              // 1.0 to 4.0
float radiusoffset = 1.0;              // -1.0 to 1.0
float skew = 0.0;                      //
llSetPrimitiveParams( [PRIM_TYPE, PRIM_TYPE_TORUS, PRIM_HOLE_DEFAULT,
                        cut, hollow, twist, holesize, topshear,
                        profilecut, taper_a, revolutions,
                        radiusoffset, skew] );</source>
|constants=
|constants=
{{LSL ConstRow|PRIM_TYPE}}
{{LSL ConstRow|PRIM_TYPE}}

Latest revision as of 17:05, 23 January 2015

Description

Constant: integer PRIM_TYPE_TORUS = 4;

The integer constant PRIM_TYPE_TORUS has the value 4

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

PRIM_TYPE

[ PRIM_TYPE, PRIM_TYPE_TORUS, integer hole_shape, vector cut, float hollow, vector twist, vector hole_size, vector top_shear, vector advanced_cut, vector taper, float revolutions, float radius_offset, float skew ]
• 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 (-360 degree in the edit window) to 1.0 (+360 degree in the edit window) for both x and y (z is ignored)
• vector hole_size x ranges from 0.05 to 1.0; y ranges from 0.05 (large hole) to 0.50 (no hole)
• vector top_shear ranges from -0.5 to 0.5 for both x and y (z is ignored)
• vector advanced_cut x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)
• vector taper ranges from -1.0 to 1.0 for both x and y (z is ignored)
• float revolutions ranges from 1.0 to 4.00
• float radius_offset depends on holesize.y and revolutions
• float skew ranges from -1.0 to 1.0
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_TORUS, vector cut, float hollow, float twist_end, float hole_size_y, vector top_shear, vector advanced_cut ]
• 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_end ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window)
• float hole_size_y ranges from 0.05 (large hole) to 0.50 (no hole)
• vector top_shear ranges from -0.5 to 0.5 for both x and y (z is ignored)
• vector advanced_cut x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)

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

Related Articles

Constants

•  PRIM_TYPE
•  CHANGED_SHAPE

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPrimitiveParams

Events

•  changed

Examples

// this makes a nice expanding spiral 
vector cut= <0.00000, 1.00000, 0.00000>; 
float hollow = 0.0;                    // 0.0 to 0.95
vector twist = <0, 0.0, 0.0>;          // -1.0 to 1.0
vector holesize = <1.0, 0.05, 0.0>;    // max X:1.0 Y:0.5
vector topshear = <0.0, 0.0, 0.0>;     // -0.5 to 0.5
vector profilecut = <0.0, 0.0, 0.0>;   // 0.0 to 1.0
vector taper_a = <0.0, 0.0, 0.0>;      // 0.0 to 1.0
float revolutions = 3.0;               // 1.0 to 4.0
float radiusoffset = 1.0;              // -1.0 to 1.0
float skew = 0.0;                      // 
llSetPrimitiveParams( [PRIM_TYPE, PRIM_TYPE_TORUS, PRIM_HOLE_DEFAULT,
                        cut, hollow, twist, holesize, topshear,
                        profilecut, taper_a, revolutions, 
                        radiusoffset, skew] );

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_TYPE_TORUS = 4;