diff options
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/PulseScript.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/PulseScript.cs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/PulseScript.cs b/OpenSim/Region/Examples/SimpleApp/PulseScript.cs index 01a9bda..b65765c 100644 --- a/OpenSim/Region/Examples/SimpleApp/PulseScript.cs +++ b/OpenSim/Region/Examples/SimpleApp/PulseScript.cs | |||
@@ -5,48 +5,48 @@ using OpenSim.Region.Scripting; | |||
5 | using OpenSim.Region.Environment.Scenes; | 5 | using OpenSim.Region.Environment.Scenes; |
6 | namespace SimpleApp | 6 | namespace SimpleApp |
7 | { | 7 | { |
8 | public class PulseScript :IScript | 8 | public class PulseScript : IScript |
9 | { | 9 | { |
10 | ScriptInfo script; | 10 | ScriptInfo script; |
11 | 11 | ||
12 | private libsecondlife.LLVector3 pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f); | 12 | private libsecondlife.LLVector3 pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f); |
13 | public string getName() | 13 | public string getName() |
14 | { | 14 | { |
15 | return "pulseScript 0.1"; | 15 | return "pulseScript 0.1"; |
16 | } | 16 | } |
17 | 17 | ||
18 | public void Initialise(ScriptInfo scriptInfo) | 18 | public void Initialise(ScriptInfo scriptInfo) |
19 | { | 19 | { |
20 | script = scriptInfo; | 20 | script = scriptInfo; |
21 | script.events.OnFrame += new EventManager.OnFrameDelegate(events_OnFrame); | 21 | script.events.OnFrame += new EventManager.OnFrameDelegate(events_OnFrame); |
22 | script.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence); | 22 | script.events.OnNewPresence += new EventManager.OnNewPresenceDelegate(events_OnNewPresence); |
23 | } | 23 | } |
24 | 24 | ||
25 | void events_OnNewPresence(ScenePresence presence) | 25 | void events_OnNewPresence(ScenePresence presence) |
26 | { | 26 | { |
27 | script.logger.Verbose("Hello " + presence.firstname.ToString() + "!"); | 27 | script.logger.Verbose("Hello " + presence.firstname.ToString() + "!"); |
28 | } | 28 | } |
29 | 29 | ||
30 | void events_OnFrame() | 30 | void events_OnFrame() |
31 | { | ||
32 | foreach (EntityBase ent in this.script.world.Entities.Values) | ||
31 | { | 33 | { |
32 | foreach(EntityBase ent in this.script.world.Entities.Values) | 34 | if (ent is SceneObject) |
33 | { | 35 | { |
34 | if (ent is SceneObject) | 36 | SceneObject prim = (SceneObject)ent; |
35 | { | 37 | if ((prim.rootPrimitive.Scale.X > 1) && (prim.rootPrimitive.Scale.Y > 1) && (prim.rootPrimitive.Scale.Z > 1)) |
36 | SceneObject prim = (SceneObject)ent; | 38 | { |
37 | if ((prim.rootPrimitive.Scale.X > 1) && (prim.rootPrimitive.Scale.Y > 1) && (prim.rootPrimitive.Scale.Z > 1)) | 39 | this.pulse = new libsecondlife.LLVector3(-0.1f, -0.1f, -0.1f); |
38 | { | 40 | } |
39 | this.pulse = new libsecondlife.LLVector3(-0.1f, -0.1f, -0.1f); | 41 | else if ((prim.rootPrimitive.Scale.X < 0.2f) && (prim.rootPrimitive.Scale.Y < 0.2f) && (prim.rootPrimitive.Scale.Z < 0.2f)) |
40 | } | 42 | { |
41 | else if ((prim.rootPrimitive.Scale.X < 0.2f) && (prim.rootPrimitive.Scale.Y < 0.2f) && (prim.rootPrimitive.Scale.Z < 0.2f)) | 43 | pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f); |
42 | { | 44 | } |
43 | pulse = new libsecondlife.LLVector3(0.1f, 0.1f, 0.1f); | ||
44 | } | ||
45 | 45 | ||
46 | prim.rootPrimitive.ResizeGoup( prim.rootPrimitive.Scale + pulse); | 46 | prim.rootPrimitive.ResizeGoup(prim.rootPrimitive.Scale + pulse); |
47 | } | 47 | } |
48 | } | ||
49 | } | 48 | } |
50 | 49 | } | |
50 | |||
51 | } | 51 | } |
52 | } | 52 | } |