Create a Primitive

28 July 2019

  • C10 - added parameters for flags.

27 May 2017

  • 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.

18 August 2015

  • Release 8.40 - added.
createprimitive (Commands)
TypeCorrade progressive command
Commandcreateprimitive
DescriptionCorrade can create new primitives by using the createprimitive command.
Permissionsinteract
Parametersgroup, password, position
Last ChangesRelease 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 $0.5m$ 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 $1000$ - measured in $100\frac{kg}{m^3}$). The object density.
friction A float value (default $0.6$). The object friction.
restitution A float value (default $0.5$). The object restitution (bounciness).
gravity A float value (default $1$ - representing a gravity multiplier). The object gravity multiplier.

Notes