aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/PulseScript.cs
diff options
context:
space:
mode:
authorMW2007-07-14 13:18:02 +0000
committerMW2007-07-14 13:18:02 +0000
commita04602d9c136b882a6c72d4c3c09c3ca0d526c37 (patch)
tree5ff7df736ea67a6ab7830fa0d41a85610d900bbb /OpenSim/Region/Examples/SimpleApp/PulseScript.cs
parent*Moved the OnSignificantClientMovement event to ScenePresence. (diff)
downloadopensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.zip
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.gz
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.bz2
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.xz
Added AddPreCompiledScript method to ScriptManager.
Done some work on lbsa71's simpleApp(hope he doesn't mind): now have the avatar showing up and the terrain and his pulsating box (well except its not a box, as there seems to be something wrong with our PrimitiveBaseShape..DefaultBox() settings). Also noticed a few other problems that I had to work around, so these need looking into.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/PulseScript.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/PulseScript.cs b/OpenSim/Region/Examples/SimpleApp/PulseScript.cs
new file mode 100644
index 0000000..01a9bda
--- /dev/null
+++ b/OpenSim/Region/Examples/SimpleApp/PulseScript.cs
@@ -0,0 +1,52 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Region.Scripting;
5using OpenSim.Region.Environment.Scenes;
6namespace SimpleApp
7{
8 public class PulseScript :IScript
9 {
10 ScriptInfo script;
11
12 private libsecondlife.LLVector3 pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f);
13 public string getName()
14 {
15 return "pulseScript 0.1";
16 }
17
18 public void Initialise(ScriptInfo scriptInfo)
19 {
20 script = scriptInfo;
21 script.events.OnFrame += new EventManager.OnFrameDelegate(events_OnFrame);
22 script.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence);
23 }
24
25 void events_OnNewPresence(ScenePresence presence)
26 {
27 script.logger.Verbose("Hello " + presence.firstname.ToString() + "!");
28 }
29
30 void events_OnFrame()
31 {
32 foreach(EntityBase ent in this.script.world.Entities.Values)
33 {
34 if (ent is SceneObject)
35 {
36 SceneObject prim = (SceneObject)ent;
37 if ((prim.rootPrimitive.Scale.X > 1) && (prim.rootPrimitive.Scale.Y > 1) && (prim.rootPrimitive.Scale.Z > 1))
38 {
39 this.pulse = new libsecondlife.LLVector3(-0.1f, -0.1f, -0.1f);
40 }
41 else if ((prim.rootPrimitive.Scale.X < 0.2f) && (prim.rootPrimitive.Scale.Y < 0.2f) && (prim.rootPrimitive.Scale.Z < 0.2f))
42 {
43 pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f);
44 }
45
46 prim.rootPrimitive.ResizeGoup( prim.rootPrimitive.Scale + pulse);
47 }
48 }
49 }
50
51 }
52}