corrade-lsl-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 30  →  ?path2? @ 31
/source/heads-up-display/teleport/teleport.lsl
@@ -182,6 +182,30 @@
state_entry() {
// DEBUG
llOwnerSay("Teleporting...");
/*
* These calculations achieve the following:
* - teleport Corrade in front of you at a distance the size of your bounding box,
* - make Corrade turn towards 1m in front of its position after the teleport
* The reason for doing this is that radar object detection is dependent on the
* position that Corrade is facing.
*/
// Get the avatar global position and rotation.
list details = llGetObjectDetails(llGetOwner(), [OBJECT_POS, OBJECT_ROT]);
// Extract the position and rotation.
vector pos = llList2Vector(details, 0);
quaternion rot = llList2Rot(details, 1);
// Compute the scale of the avatar (side of cuboid).
list box = llGetBoundingBox(llGetOwner());
vector a = llList2Vector(box, 0);
vector b = llList2Vector(box, 1);
float size = b.x - a.x;
vector position = <size, 0, 0> * rot + llGetPos();
vector lookAt = (<1, 0, 0> + <size, 0, 0>) * rot + llGetPos();
llInstantMessage(
(key)wasKeyValueGet(
"corrade",
@@ -192,7 +216,7 @@
"command", "teleport",
"group", wasURLEscape(
wasKeyValueGet(
"group",
"group",
configuration
)
),
@@ -207,11 +231,13 @@
llGetRegionName()
),
"deanimate", "True",
"position", llGetPos(),
"position", wasURLEscape((string)position),
"turnto", wasURLEscape((string)lookAt),
"callback", wasURLEscape(callback)
]
)
);
llSetTimerEvent(60);
}
timer() {
@@ -232,7 +258,7 @@
llOwnerSay("Teleport failed with failure message: " +
wasURLUnescape(
wasKeyValueGet(
"error",
"data",
body
)
)
/source/heads-up-display/touch/touch.lsl
@@ -316,7 +316,7 @@
state scan {
state_entry() {
// DEBUG
llOwnerSay("Getting objects...");
llOwnerSay("Getting primitives...");
llInstantMessage(
wasKeyValueGet(
"corrade",
@@ -324,7 +324,7 @@
),
wasKeyValueEncode(
[
"command", "getobjectsdata",
"command", "getprimitivesdata",
"group", wasURLEscape(
wasKeyValueGet(
"group",
@@ -366,7 +366,7 @@
}
http_request(key id, string method, string body) {
llHTTPResponse(id, 200, "OK");
if(wasKeyValueGet("command", body) != "getobjectsdata" ||
if(wasKeyValueGet("command", body) != "getprimitivesdata" ||
wasKeyValueGet("success", body) != "True") {
// DEBUG
llOwnerSay("Unable to query primitives data: " +