28 July 2019

27 May 2017

18 August 2015

Corrade can create new primitives by using the createprimitive command.

CommandRequired ParametersRequired Corrade PermissionsExample
createprimitivegroup, password, positioninteract
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 ParameterPossible ValueDescription
nameA string.The name of the newly created primitive.
permissionsA permission string.The permissions to set on the created object.
descriptionA string.The description of the newly created primitive.
rangeA range in meters.The spherical distance from Corrade in which to locate the item.
rotationA rotation in quaternions.The primitive rotation. If not specified, the primitive will have a zero rotation.
regionA region name.The region where to create the primitive. If not specified, the primitive will be created in the local simulator.
scaleA 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.
flagsA CSV list of members from the PrimFlags structure.Various flags for the primitive being created.
dataA CSV list of members from the ConstructionDataThe data to construct the primitive by.
shapePlease 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.
temporaryTrue or FalseWhether the object is temporary.
shadowsTrue or FalseWhether the object casts shadows - this is deprecated and does nothing.
restitutionSingleThe primitive's restitution.
phantomTrue or FalseWhether the primitive is a phantom.
frictionSingleThe fiction of the primitive.
densitySingleThe density of the primitive.
physicsTrue or FalseWhether the object has physics enabled.
typeOne of PhysicsShapeType.The physics shape.
densityA float value (default $1000$ - measured in $100\frac{kg}{m^3}$).The object density.
frictionA float value (default $0.6$).The object friction.
restitutionA float value (default $0.5$).The object restitution (bounciness).
gravityA float value (default $1$ - representing a gravity multiplier).The object gravity multiplier.

Notes