aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
diff options
context:
space:
mode:
authorSean Dague2007-07-16 15:40:11 +0000
committerSean Dague2007-07-16 15:40:11 +0000
commit2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch)
treee3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
parent*Trunk compiles now (diff)
downloadopensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz
changed to native line ending encoding
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MySceneObject.cs80
1 files changed, 40 insertions, 40 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
index aab52cc..f5c6a0f 100644
--- a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
@@ -1,40 +1,40 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Region.Environment.Scenes; 4using OpenSim.Region.Environment.Scenes;
5using libsecondlife; 5using libsecondlife;
6using OpenSim.Framework.Types; 6using OpenSim.Framework.Types;
7using System.Timers; 7using System.Timers;
8using System.Diagnostics; 8using System.Diagnostics;
9 9
10namespace SimpleApp 10namespace SimpleApp
11{ 11{
12 public class MySceneObject : SceneObject 12 public class MySceneObject : SceneObject
13 { 13 {
14 private PerformanceCounter m_counter; 14 private PerformanceCounter m_counter;
15 15
16 public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) 16 public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
17 : base(world, eventManager, ownerID, localID, pos, shape ) 17 : base(world, eventManager, ownerID, localID, pos, shape )
18 { 18 {
19 String objectName = "Processor"; 19 String objectName = "Processor";
20 String counterName = "% Processor Time"; 20 String counterName = "% Processor Time";
21 String instanceName = "_Total"; 21 String instanceName = "_Total";
22 22
23 m_counter = new PerformanceCounter(objectName, counterName, instanceName); 23 m_counter = new PerformanceCounter(objectName, counterName, instanceName);
24 24
25 Timer timer = new Timer(); 25 Timer timer = new Timer();
26 timer.Enabled = true; 26 timer.Enabled = true;
27 timer.Interval = 100; 27 timer.Interval = 100;
28 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); 28 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
29 29
30 } 30 }
31 31
32 public void Heartbeat(object sender, EventArgs e) 32 public void Heartbeat(object sender, EventArgs e)
33 { 33 {
34 float cpu = m_counter.NextValue() / 40f; 34 float cpu = m_counter.NextValue() / 40f;
35 LLVector3 size = new LLVector3(cpu, cpu, cpu); 35 LLVector3 size = new LLVector3(cpu, cpu, cpu);
36 rootPrimitive.ResizeGoup( size ); 36 rootPrimitive.ResizeGoup( size );
37 update(); 37 update();
38 } 38 }
39 } 39 }
40} 40}