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

  • The way that Corrade rezzes primitives is usually to start from a built-in body specified by 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:
    • In case neither data or type is specified, then Corrade will set the primitive to the cube built-in type.
    • In case only type is specified, the body type will be rezzed with no modifications.
    • In case only 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.
    • If both 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.
  • The command returns the UUID of the newly created primitive.
  • The 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.
    • The optional parameters for setting primitive flags are related to the parameters set by the setprimitiveflags command.

secondlife/scripted_agents/corrade/api/commands/createprimitive.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.