28 July 2019
27 May 2017
18 August 2015
createprimitive (Commands) | |
---|---|
Type | Corrade progressive command |
Command | createprimitive |
Description | Corrade can create new primitives by using the createprimitive command. |
Permissions | interact |
Parameters | group , password , position |
Last Changes | Release 9.164 - now allows setting the name, description and permissions of the newly created primitive. Furthermore, the command now returns the UUID of the newly created primitive for easily reusing with other commands. |
Corrade can create new primitives by using the createprimitive
command.
Command | Required Parameters | Required Corrade Permissions | Example |
---|---|---|---|
createprimitive | group , password , position | interact | llInstantMessage(CORRADE, wasKeyValueEncode( [ "command", "createprimitive", "group", wasURLEscape(GROUP), "password", wasURLEscape(PASSWORD), // the position at which to create the // new primitive. "position", wasURLEscape( (string)(<169.770218, 162.512756, 3402.75>) ), // start with a sphere "shape", "sphere", // set the name of the newly created // primitive to "ball" "name", "ball", // set the description of the newly // created primitive to "bouncy" "description", "bouncy", // override the sphere material // and make it out of glass "data", wasListToCSV([ "Material", "Glass" ]), // and turn physics on "physics", "True", "callback", wasURLEscape(URL) ] ) ); |
Optional Parameter | Possible Value | Description |
---|---|---|
name | A string. | The name of the newly created primitive. |
description | A string. | The description of the newly created primitive. |
range | A range in meters. | The spherical distance from Corrade in which to locate the item. |
rotation | A rotation in quaternions. | The primitive rotation. If not specified, the primitive will have a zero rotation. |
region | A region name. | The region where to create the primitive. If not specified, the primitive will be created in the local simulator. |
scale | A vector describing the scale of the primitive to create. | The size of the the primitive to create. If not specified the primitive will be scaled to on all three axes. |
flags | A CSV list of members from the PrimFlags structure. | Various flags for the primitive being created. |
data | A CSV list of members from the ConstructionData | The data to construct the primitive by. |
shape | Please see the Corrade built-in body types. | The initial body to start from, after which the parameters in data get applied. If you do not supply this parameter then data will start off with a cube. |
temporary | True or False | Whether the object is temporary. |
shadows | True or False | Whether the object casts shadows - this is deprecated and does nothing. |
restitution | Single | The primitive's restitution. |
phantom | True or False | Whether the primitive is a phantom. |
friction | Single | The fiction of the primitive. |
density | Single | The density of the primitive. |
physics | True or False | Whether the object has physics enabled. |
type | One of PhysicsShapeType. | The physics shape. |
density | A float value (default - measured in ). | The object density. |
friction | A float value (default ). | The object friction. |
restitution | A float value (default ). | The object restitution (bounciness). |
gravity | A float value (default - representing a gravity multiplier). | The object gravity multiplier. |
type
after which the parameters get altered by the data
parameter (see the example call for the command). There are four cases depending on whether data
or type
are specified:data
or type
is specified, then Corrade will set the primitive to the cube
built-in type.type
is specified, the body type will be rezzed with no modifications.data
is specified, then the primitive will be rezzed by setting the default body type to cube
and then altering the primitive using the parameters specified in data
.type
and data
is specified, then Corrade will start off from the specified body type and then alter that body by setting its parameters to those specified in data
.flags
parameter that refers to PrimFlags can set some server parameters but some flags such as Physics
or Temporary
will not work. To set flags such as Physics
, Temporary
or Phantom
please use the other optional parameters.