diff options
author | lbsa71 | 2007-08-15 16:57:47 +0000 |
---|---|---|
committer | lbsa71 | 2007-08-15 16:57:47 +0000 |
commit | c47bca94d23420b164e5f32aa5c781009496e0d3 (patch) | |
tree | 1334b22e0580c1584a7ef7dfb537339992f2b0ef /OpenSim/Region/Examples/SimpleApp | |
parent | * Applying ckrinke's LSL baseclass changes (Thanks!) (diff) | |
download | opensim-SC_OLD-c47bca94d23420b164e5f32aa5c781009496e0d3.zip opensim-SC_OLD-c47bca94d23420b164e5f32aa5c781009496e0d3.tar.gz opensim-SC_OLD-c47bca94d23420b164e5f32aa5c781009496e0d3.tar.bz2 opensim-SC_OLD-c47bca94d23420b164e5f32aa5c781009496e0d3.tar.xz |
* Exploring Group/Part from an app perspective.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/ComplexObject.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 13 |
3 files changed, 55 insertions, 8 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs new file mode 100644 index 0000000..25960b7 --- /dev/null +++ b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs | |||
@@ -0,0 +1,46 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Region.Environment.Scenes; | ||
5 | using Axiom.Math; | ||
6 | using libsecondlife; | ||
7 | using OpenSim.Framework.Types; | ||
8 | |||
9 | namespace SimpleApp | ||
10 | { | ||
11 | public class ComplexObject : SceneObjectGroup | ||
12 | { | ||
13 | private LLQuaternion m_rotationDirection; | ||
14 | |||
15 | private class RotatingWheel : SceneObjectPart | ||
16 | { | ||
17 | private static LLQuaternion m_rotationDirection = new LLQuaternion(0.05f, 0, 0); | ||
18 | |||
19 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition) | ||
20 | : base(regionHandle, parent, ownerID, localID, BoxShape.Default, groupPosition, offsetPosition ) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | public override void UpdateMovement() | ||
25 | { | ||
26 | UpdateRotation(RotationOffset * m_rotationDirection); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | public override void UpdateMovement() | ||
31 | { | ||
32 | UpdateGroupRotation(Rotation * m_rotationDirection); | ||
33 | |||
34 | base.UpdateMovement(); | ||
35 | } | ||
36 | |||
37 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos ) | ||
38 | : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default ) | ||
39 | { | ||
40 | m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); | ||
41 | |||
42 | AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 1f))); | ||
43 | AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -1f))); | ||
44 | } | ||
45 | } | ||
46 | } | ||
diff --git a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs index 108fa98..4ce59cb 100644 --- a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs | |||
@@ -13,8 +13,8 @@ namespace SimpleApp | |||
13 | { | 13 | { |
14 | private PerformanceCounter m_counter; | 14 | private PerformanceCounter m_counter; |
15 | 15 | ||
16 | public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) | 16 | public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos ) |
17 | : base(world, regionHandle, ownerID, localID, pos, shape ) | 17 | : base(world, regionHandle, ownerID, localID, pos, BoxShape.Default ) |
18 | { | 18 | { |
19 | String objectName = "Processor"; | 19 | String objectName = "Processor"; |
20 | String counterName = "% Processor Time"; | 20 | String counterName = "% Processor Time"; |
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 0763b83..59d73ba 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -65,14 +65,15 @@ namespace SimpleApp | |||
65 | 65 | ||
66 | udpServer.ServerListener(); | 66 | udpServer.ServerListener(); |
67 | 67 | ||
68 | PrimitiveBaseShape shape = BoxShape.Default; | 68 | LLVector3 pos = new LLVector3(110, 129, 27); |
69 | shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | ||
70 | LLVector3 pos = new LLVector3(138, 129, 27); | ||
71 | 69 | ||
72 | SceneObjectGroup sceneObject = new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); | 70 | SceneObjectGroup sceneObject = new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + new LLVector3( 1f, 1f, 1f )); |
73 | scene.AddEntity(sceneObject); | 71 | scene.AddEntity(sceneObject); |
74 | 72 | ||
75 | MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager ); | 73 | ComplexObject complexObject = new ComplexObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + new LLVector3( 2f, 2f, 2f )); |
74 | scene.AddEntity(complexObject); | ||
75 | |||
76 | MyNpcCharacter m_character = new MyNpcCharacter(scene.EventManager); | ||
76 | scene.AddNewClient(m_character, false); | 77 | scene.AddNewClient(m_character, false); |
77 | 78 | ||
78 | DirectoryInfo dirInfo = new DirectoryInfo( "." ); | 79 | DirectoryInfo dirInfo = new DirectoryInfo( "." ); |