aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/assets/ScriptsAssetSet/KanEd-Test07.lsl
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-12 18:00:46 +0000
committerJustin Clarke Casey2009-01-12 18:00:46 +0000
commitfb8faa8336ddb795ccd6840259b06a2608350a57 (patch)
tree1f4977b9918d416602af88709e15aecf9499b969 /bin/assets/ScriptsAssetSet/KanEd-Test07.lsl
parent* Remove FunSLUDP code since this has moved to http://forge.opensimulator.org... (diff)
downloadopensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.zip
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.gz
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.bz2
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2913
* Add the KanEd scripts to the standard library * Thanks Fly-Man-
Diffstat (limited to '')
-rw-r--r--bin/assets/ScriptsAssetSet/KanEd-Test07.lsl38
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/KanEd-Test07.lsl b/bin/assets/ScriptsAssetSet/KanEd-Test07.lsl
new file mode 100644
index 0000000..a1258f9
--- /dev/null
+++ b/bin/assets/ScriptsAssetSet/KanEd-Test07.lsl
@@ -0,0 +1,38 @@
1vector rotationCenter;
2
3default
4{
5 state_entry()
6 {
7 llSay( 0, "Hello, Avatar!");
8 vector startPoint = llGetPos();
9 rotationCenter = startPoint + < 3, 3, 3 >;
10 // distance to the point of rotation should probably be a
11 // function of the max dimension of the object.
12 }
13
14 touch_start(integer total_number)
15 {
16 llSay( 0, "Touched." );
17
18 // Define a "rotation" of 10 degrees around the z-axis.
19 rotation Z_15 = llEuler2Rot( < 0, 0, 15 * DEG_TO_RAD > );
20
21 integer i;
22 for( i = 1; i < 100; i++ ) // limit simulation time in case of
23 { // unexpected behavior.
24 vector currentPosition = llGetPos();
25
26 vector currentOffset = currentPosition - rotationCenter;
27
28 // rotate the offset vector in the X-Y plane around the
29 // distant point of rotation.
30 vector rotatedOffset = currentOffset * Z_15;
31 vector newPosition = rotationCenter + rotatedOffset;
32
33 llSetPos( newPosition );
34 }
35 llSay( 0, "Orbiting stopped" );
36 }
37}
38