diff options
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MySceneObject.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs new file mode 100644 index 0000000..8508dac --- /dev/null +++ b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | |||
@@ -0,0 +1,40 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Region.Environment.Scenes; | ||
5 | using libsecondlife; | ||
6 | using OpenSim.Framework.Types; | ||
7 | using System.Timers; | ||
8 | |||
9 | namespace SimpleApp | ||
10 | { | ||
11 | public class MySceneObject : SceneObject | ||
12 | { | ||
13 | LLVector3 delta = new LLVector3(0.1f, 0.1f, 0.1f); | ||
14 | |||
15 | public MySceneObject(Scene world, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) | ||
16 | : base(world, ownerID, localID, pos, shape ) | ||
17 | { | ||
18 | Timer timer = new Timer(); | ||
19 | timer.Enabled = true; | ||
20 | timer.Interval = 100; | ||
21 | timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); | ||
22 | } | ||
23 | |||
24 | public void Heartbeat(object sender, EventArgs e) | ||
25 | { | ||
26 | if (rootPrimitive.Scale.X > 1) | ||
27 | { | ||
28 | delta = new LLVector3(-0.1f, -0.1f, -0.1f); | ||
29 | } | ||
30 | |||
31 | if (rootPrimitive.Scale.X < 0.2f) | ||
32 | { | ||
33 | delta = new LLVector3(0.1f, 0.1f, 0.1f); | ||
34 | } | ||
35 | |||
36 | rootPrimitive.ResizeGoup(rootPrimitive.Scale + delta); | ||
37 | update(); | ||
38 | } | ||
39 | } | ||
40 | } | ||