Querying Primitives

Corrade can fetch primitive details of any primitive in the current region and deliver them as CSV to LSL scripts. This includes all aspects of a primitive as it is given by the Primitive class of libomv.

Provided that you have requested an URL from the simulator, the following command will get the primitive textures, the primitive position and the primitive rotation:

default {
    state_entry() {
        llInstantMessage(CORRADE, 
            wasKeyValueEncode(
                [
                    "command", "getprimitivedata",
                    "group", GROUP,
                    "password", PASSWORD,
                    "item", "testobject",
                    "data", wasListToCSV(
                        [
                            "Properties.TextureIDs",
                            "Position",
                            "Rotation"
                        ]
                    ),
                    "callback", URL
 
                ]
            )
        );
    }
}

and will make Corrade the data to the supplied callback URL:

data=Properties.TextureIDs,89556747-24cb-43ed-920b-47caed15465f,89556747-24cb-43ed-920b-47caed15465f,89556747-24cb-43ed-920b-47caed15465f,89556747-24cb-43ed-920b-47caed15465f,89556747-24cb-43ed-920b-47caed15465f,89556747-24cb-43ed-920b-47caed15465f,Rotation,"<-0.142504, 0.6993973, 0.687007, -0.1361868>",Position,"<31.37694, 118.4525, 21.0452>"

You can query any field in the Primitive class or subclasses of libomv.

Index


secondlife/scripted_agents/corrade/tutorials/querying_primitives.txt ยท Last modified: 2020/05/27 12:56 (external edit)

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


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