Difference between revisions of "PRIM TYPE SPHERE"
Jump to navigation
Jump to search
(New page: {{#if: {{LSL_Constants/PrimitiveParams}} }}{{LSL Constant |name=PRIM_TYPE_SPHERE |type=integer |value=3 |desc= |examples= |constants= {{LSL ConstRow|PRIM_TYPE}} {{LSL ConstRow|CHANGED_SHAP...) |
m (<lsl> tag to <source>) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#if: | {{#if: | ||
{{ | {{:PRIM_TYPE}} | ||
}}{{LSL Constant | }}{{LSL Constant | ||
|name=PRIM_TYPE_SPHERE | |name=PRIM_TYPE_SPHERE | ||
|type=integer | |type=integer | ||
|value=3 | |value=3 | ||
|desc= | |desc=PRIM_TYPE_SPHERE is a parameter of [[PRIM_TYPE]] used to make prim into a sphere and to change specific properties that define the shape of that sphere. | ||
|pa={{LSL Constant/List|i_front=[ {{LSL_Const|PRIM_TYPE|integer|9}}, [[PRIM_TYPE_SPHERE]], |i_end= ] | |||
|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=cut|i5_disp=dimple | |||
|toc=PRIM_TYPE | |||
}} | |||
|pb={{LSL Constant/List|i_front=[ 1, [[PRIM_TYPE_SPHERE]], |i_end= ] | |||
|text=This is the old PRIM_TYPE format for the sphere (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=vector|i3_name=cut|i3_disp=dimple | |||
|toc=PRIM_TYPE_LEGACY | |||
}} | |||
|examples= | |examples= | ||
<source lang="lsl2">// this makes a simple sphere | |||
vector cut = <0.0, 1.0, 0.0>; // 0.0 to 1.0 | |||
float hollow = 0.0; // 0.0 to 0.95 | |||
vector twist = <0.0, 0.0, 0.0>; // -1.0 to 1.0 | |||
vector dimple = <0.0, 1.0, 0.0>; // 0.0 to 1.0 | |||
llSetPrimitiveParams( [PRIM_TYPE, PRIM_TYPE_SPHERE, PRIM_HOLE_DEFAULT, | |||
cut, hollow, twist, dimple ] );</source> | |||
|constants= | |constants= | ||
{{LSL ConstRow|PRIM_TYPE}} | {{LSL ConstRow|PRIM_TYPE}} |
Latest revision as of 17:05, 23 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_TYPE_SPHERE = 3;The integer constant PRIM_TYPE_SPHERE has the value 3
PRIM_TYPE_SPHERE is a parameter of PRIM_TYPE used to make prim into a sphere and to change specific properties that define the shape of that sphere.
PRIM_TYPE
[ PRIM_TYPE, PRIM_TYPE_SPHERE, integer hole_shape, vector cut, float hollow, vector twist, vector dimple ]• 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 | dimple | – | x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than 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_SPHERE, vector cut, float hollow, vector dimple ]• 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 | dimple | – | 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 sphere (PRIM_TYPE used to be 1 instead of 9). Use the new format unless you are maintaining old code.
Caveats
Related Articles
Constants
• | PRIM_TYPE | |||
• | CHANGED_SHAPE |
Functions
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPrimitiveParams |
Events
• | changed |
Examples
// this makes a simple sphere
vector cut = <0.0, 1.0, 0.0>; // 0.0 to 1.0
float hollow = 0.0; // 0.0 to 0.95
vector twist = <0.0, 0.0, 0.0>; // -1.0 to 1.0
vector dimple = <0.0, 1.0, 0.0>; // 0.0 to 1.0
llSetPrimitiveParams( [PRIM_TYPE, PRIM_TYPE_SPHERE, PRIM_HOLE_DEFAULT,
cut, hollow, twist, dimple ] );