Difference between revisions of "PRIM TYPE"

From Second Life Wiki
Jump to navigation Jump to search
m
(see how this looks)
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<onlyinclude>{{#if:
<onlyinclude>{{#if:
{{#vardefine:p_type_flag_desc|PRIM_TYPE_* flag}}
{{#vardefine:p_type_parameters_hover|a list consisting of the parameters of the PRIM_TYPE_* flag}}
{{#vardefine:p_type_parameters_desc|a list consisting of the parameters of {{LSLP|flag}}}}


{{#vardefine:p_hole_shape_desc|PRIM_HOLE_* flag}}
{{#vardefine:p_hole_shape_desc|PRIM_HOLE_* flag}}
{{#vardefine:p_cut_desc|x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)}}
{{#vardefine:p_cut_desc|x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored)}}
{{#vardefine:p_hollow_desc|ranges from 0.0 (solid) to 0.95 (maximum hollowed)}}
{{#vardefine:p_hollow_desc|ranges from 0.0 (solid) to 0.95 (maximum hollowed)}}
{{#vardefine:p_twist_box_desc|ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window) for both x and y (z is ignored)}}
{{#vardefine:p_twist_box_desc|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)}}
{{#vardefine:p_twist_torus_desc|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)}}
{{#vardefine:p_twist_torus_desc|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)}}
{{#vardefine:p_hole_size_desc|x ranges from 0.05 to 1.0; y ranges from 0.05 (large hole) to 0.50 (no hole)}}
{{#vardefine:p_hole_size_desc|x ranges from 0.05 to 1.0; y ranges from 0.05 (large hole) to 0.50 (no hole)}}
{{#vardefine:p_top_size_desc|ranges from 0.0 to 1.0 for both x and y (z is ignored)}}
 
{{#vardefine:p_z_taper_desc|ranges from 0.0 to 2.0 for both x and y (z is ignored)}}
{{#vardefine:p_top_size_hover|ranges from 0.0 (top fully tapered) to 1.0 (no tapering) for both x and y (z is ignored); see Caveats about the differences between the client and scripting range for this value}}
{{#vardefine:p_top_size_desc|ranges from {{HoverText|0.0|Top fully tapered}} to {{HoverText|1.0|No tapering}} for both x and y (z is ignored)[[#z_taper|<span style="color:red;" title="The values for in the client and scripting are different!">!</span>]]}}
{{#vardefine:p_z_taper_hover|ranges from 0.0 (top fully tapered) to 1.0 (no tapering) to 2.0 (bottom fully tapered) for both x and y (z is ignored); see Caveats about the differences between the client and scripting range for this value}}
{{#vardefine:p_z_taper_desc|ranges from {{HoverText|0.0|Top fully tapered}} to {{HoverText|1.0|No tapering}} to {{HoverText|2.0|Bottom fully tapered}} for both x and y (z is ignored)[[#z_taper|<span style="color:red;" title="The values for in the client and scripting are different!">!</span>]]}}
 
{{#vardefine:p_top_shear_desc|ranges from -0.5 to 0.5 for both x and y (z is ignored)}}
{{#vardefine:p_top_shear_desc|ranges from -0.5 to 0.5 for both x and y (z is ignored)}}
{{#vardefine:p_taper_desc|ranges from -1.0 to 1.0 for both x and y (z is ignored)}}
{{#vardefine:p_taper_desc|ranges from -1.0 to 1.0 for both x and y (z is ignored)}}
{{#vardefine:p_revolutions_desc|ranges from 1.0 to 4.00}}
{{#vardefine:p_revolutions_desc|ranges from 1.0 to 4.00}}
{{#vardefine:p_radius_offset_desc|depends on holesize y and revolutions}}
{{#vardefine:p_radius_offset_desc|depends on holesize.y and revolutions}}
{{#vardefine:p_skew_desc|ranges from -1.0 to 1.0}}
{{#vardefine:p_skew_desc|ranges from -1.0 to 1.0}}


<!-- The old PRIM_TYPE (PRIM_TYPE_LEGACY) variables -->
{{#vardefine:p_twist_end_desc|ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window)}}
{{#vardefine:p_twist_end_desc|ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window)}}
{{#vardefine:p_hole_size_y_desc|ranges from 0.05 (large hole) to 0.50 (no hole)}}
{{#vardefine:p_hole_size_y_desc|ranges from 0.05 (large hole) to 0.50 (no hole)}}
{{#vardefine:p_topshear_x_desc|ranges from 0.05 to 0.50}}
{{#vardefine:p_topshear_x_desc|ranges from 0.05 to 0.50}}
{{#vardefine:type_const|{{LSL Const|PRIM_TYPE|integer|9|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the the type of prim.}}}}
{{#vardefine:caveats-set|{{#var:caveats-set}}
* {{#var:type_const}} can only be used with [[LINK_SET]] if the object contains 10 or fewer prims. It can only be used with [[LINK_ALL_OTHERS]] or [[LINK_ALL_CHILDREN]] if the object contains 11 or fewer prims. If there are more prims, the operation will fail and an error will be shouted to [[DEBUG_CHANNEL]]. Work around this by looping through the prims with [[llSetLinkPrimitiveParamsFast]].
* {{#var:type_const}} will silently fail when executed by a script placed inside a mesh, whether the affect object is the mesh or not (in linksets for example), use a normal prim as your root prim.
}}
{{#switch:{{{1|}}}
|get={{#vardefine:caveats|{{#var:caveats}}
{{#var:caveats-get}}{{#vardefine:caveats-get}}}}
|set={{#vardefine:caveats|{{#var:caveats}}
{{#var:caveats-set}}{{#vardefine:caveats-set}}}}
}}


}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:


{{:PRIM_TYPE_SCULPT}}
{{:PRIM_TYPE_SCULPT|{{{1|}}}}}


}}{{LSL Constant
}}{{LSL Constant
|inject-2={{LSL PrimitiveParam Categorize|Prim}}
|name=PRIM_TYPE
|name=PRIM_TYPE
|type=integer
|type=integer
|value=9
|value=9
|desc=Sets the type of the prim
|desc=Gets or sets the {{LSLP|type_flag|type}} of the prim and associated type {{LSLP|type_parameters|parameters}}.
|examples
|examples
|pa={{LSL Constant/List|i_front=[&#32;{{#var:type_const}},&#32;|i_end=&nbsp;]&nbsp;+ {{LSLPT|type_parameters|flag_parameters}}
|text=Used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]].
The values needed for {{LSLP|type_parameters|flag_parameters}} is dependent on {{LSLP|type_flag|flag}}, please refer to the individual PRIM_TYPE_* articles for additional information.
{{LSL Generic/Caveats|caveats={{#var:caveats-set}}|title=*}}
|toc=llSetPrimitiveParams
|i1_type=integer|i1_name=type_flag|i1_disp=flag
}}
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:type_const}}|i_end=&nbsp;]);|
|r_front=Returns the list <code>[&nbsp;|r_end=&nbsp;] + {{LSL Param|type_parameters|flag_parameters}}</code>
|text=The values that follow after {{LSLP|type_flag|flag}}, the {{LSLP|type_parameters|flag_parameters}}, are dependent on the value of {{LSLP|flag}}, please refer to the individual PRIM_TYPE_* articles for further information.
|toc=llGetPrimitiveParams
|r1_type=integer|r1_name=type_flag|r1_disp=flag
}}
|pc=
{{LSL_Constants/PrimitiveParams/type|table=*|simple=*|sortable=*|style=margin-top:0; margin-right:0;|{{LSLPT|type_parameters|flag_parameters}}}}
{{LSL Constants/PrimitiveParams/hole shape|table=*|simple=*|sortable=*|style=margin-top:0; margin-right:0;}}
|constants=
|constants=
{{LSL ConstRow|PRIM_TYPE_BOX}}
{{LSL ConstRow|PRIM_TYPE_CYLINDER}}
{{LSL ConstRow|PRIM_TYPE_PRISM}}
{{LSL ConstRow|PRIM_TYPE_SPHERE}}
{{LSL ConstRow|PRIM_TYPE_TORUS}}
{{LSL ConstRow|PRIM_TYPE_TUBE}}
{{LSL ConstRow|PRIM_TYPE_RING}}
{{LSL ConstRow|PRIM_TYPE_SCULPT}}
{{LSL ConstRow|CHANGED_SHAPE}}
{{LSL ConstRow|CHANGED_SHAPE}}
|functions=
|functions=
Line 46: Line 81:
{{LSL DefineRow||[[changed]]|}}
{{LSL DefineRow||[[changed]]|}}
|location
|location
|cat1=Prim
|cat1
|cat2
|cat2
|cat3
|cat4
}}
}}

Latest revision as of 10:49, 5 January 2014

Description

Constant: integer PRIM_TYPE = 9;

The integer constant PRIM_TYPE has the value 9

Gets or sets the type of the prim and associated type parameters.

llSetPrimitiveParams

[ PRIM_TYPE, integer flag ] + flag_parameters
• integer flag PRIM_TYPE_* flag

Used with llSetPrimitiveParams & llSetLinkPrimitiveParams.

The values needed for flag_parameters is dependent on flag, please refer to the individual PRIM_TYPE_* articles for additional information.

Caveats

All Issues ~ Search JIRA for related Bugs

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_TYPE ]);

Returns the list integer flag ] + flag_parameters

• integer flag PRIM_TYPE_* flag

The values that follow after flag, the flag_parameters, are dependent on the value of flag, please refer to the individual PRIM_TYPE_* articles for further information.

flag Constants flag_parameters
PRIM_TYPE_BOX 0 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_CYLINDER 1 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_PRISM 2 [ integer hole_shape, vector cut, float hollow, vector twist, vector top_size, vector top_shear ]
PRIM_TYPE_SPHERE 3 [ integer hole_shape, vector cut, float hollow, vector twist, vector dimple]
PRIM_TYPE_TORUS 4 [ 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 ]
PRIM_TYPE_TUBE 5 [ 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 ]
PRIM_TYPE_RING 6 [ 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 ]
PRIM_TYPE_SCULPT 7 [ string mapinteger type ]
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

Related Articles

Constants

•  CHANGED_SHAPE

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPrimitiveParams

Events

•  changed

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_TYPE = 9;