aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/ComplexObject.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/ComplexObject.cs156
1 files changed, 78 insertions, 78 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
index 01af4f0..50154de 100644
--- a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
@@ -1,78 +1,78 @@
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 Axiom.Math; 5using Axiom.Math;
6using libsecondlife; 6using libsecondlife;
7using OpenSim.Framework.Types; 7using OpenSim.Framework.Types;
8using OpenSim.Framework.Interfaces; 8using OpenSim.Framework.Interfaces;
9 9
10namespace SimpleApp 10namespace SimpleApp
11{ 11{
12 public class ComplexObject : SceneObjectGroup 12 public class ComplexObject : SceneObjectGroup
13 { 13 {
14 private LLQuaternion m_rotationDirection; 14 private LLQuaternion m_rotationDirection;
15 15
16 private class RotatingWheel : SceneObjectPart 16 private class RotatingWheel : SceneObjectPart
17 { 17 {
18 private LLQuaternion m_rotationDirection; 18 private LLQuaternion m_rotationDirection;
19 19
20 public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection) 20 public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
21 : base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition ) 21 : base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition )
22 { 22 {
23 m_rotationDirection = rotationDirection; 23 m_rotationDirection = rotationDirection;
24 } 24 }
25 25
26 public override void UpdateMovement() 26 public override void UpdateMovement()
27 { 27 {
28 UpdateRotation(RotationOffset * m_rotationDirection); 28 UpdateRotation(RotationOffset * m_rotationDirection);
29 } 29 }
30 } 30 }
31 31
32 public override void UpdateMovement() 32 public override void UpdateMovement()
33 { 33 {
34 UpdateGroupRotation(GroupRotation * m_rotationDirection); 34 UpdateGroupRotation(GroupRotation * m_rotationDirection);
35 35
36 base.UpdateMovement(); 36 base.UpdateMovement();
37 } 37 }
38 38
39 39
40 40
41 public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos ) 41 public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos )
42 : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default ) 42 : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default )
43 { 43 {
44 m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); 44 m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f);
45 45
46 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), new LLQuaternion(0.05f,0,0))); 46 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), new LLQuaternion(0.05f,0,0)));
47 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), new LLQuaternion(-0.05f,0,0))); 47 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), new LLQuaternion(-0.05f,0,0)));
48 48
49 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f,0), new LLQuaternion(0.5f, 0, 0.05f))); 49 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f,0), new LLQuaternion(0.5f, 0, 0.05f)));
50 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f,0), new LLQuaternion(-0.5f, 0, -0.05f))); 50 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f,0), new LLQuaternion(-0.5f, 0, -0.05f)));
51 51
52 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), new LLQuaternion(0, 0.5f, 0.05f))); 52 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), new LLQuaternion(0, 0.5f, 0.05f)));
53 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), new LLQuaternion(0, -0.5f, -0.05f))); 53 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), new LLQuaternion(0, -0.5f, -0.05f)));
54 54
55 UpdateParentIDs(); 55 UpdateParentIDs();
56 } 56 }
57 57
58 public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) 58 public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient)
59 { 59 {
60 m_parts.Remove(part.UUID); 60 m_parts.Remove(part.UUID);
61 remoteClient.SendKillObject(m_regionHandle, part.LocalID); 61 remoteClient.SendKillObject(m_regionHandle, part.LocalID);
62 remoteClient.AddMoney(1); 62 remoteClient.AddMoney(1);
63 remoteClient.SendChatMessage("Poof!", 1, this.AbsolutePosition, "Party Party", LLUUID.Zero); 63 remoteClient.SendChatMessage("Poof!", 1, this.AbsolutePosition, "Party Party", LLUUID.Zero);
64 } 64 }
65 65
66 public override void OnGrabGroup( LLVector3 offsetPos, IClientAPI remoteClient) 66 public override void OnGrabGroup( LLVector3 offsetPos, IClientAPI remoteClient)
67 { 67 {
68 if( m_parts.Count == 1 ) 68 if( m_parts.Count == 1 )
69 { 69 {
70 m_parts.Remove(m_rootPart.UUID); 70 m_parts.Remove(m_rootPart.UUID);
71 m_scene.RemoveEntity(this); 71 m_scene.RemoveEntity(this);
72 remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalID); 72 remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalID);
73 remoteClient.AddMoney(50); 73 remoteClient.AddMoney(50);
74 remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero); 74 remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero);
75 } 75 }
76 } 76 }
77 } 77 }
78} 78}