aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/General/Types/PrimitiveBaseShape.cs33
-rw-r--r--OpenSim/Region/Examples/SimpleApp/ComplexObject.cs19
2 files changed, 37 insertions, 15 deletions
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
index 577c8a2..87cf173 100644
--- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
@@ -16,9 +16,25 @@ namespace OpenSim.Framework.Types
16 public enum HollowShape : byte 16 public enum HollowShape : byte
17 { 17 {
18 Same = 0, 18 Same = 0,
19 // Fill in... 19 Circle = 16,
20 Square =32,
21 Triangle = 48
20 } 22 }
21 23
24 public enum PCodeEnum : byte
25 {
26 Primitive = 9,
27 Avatar = 47
28 }
29
30 public enum Extrusion : byte
31 {
32 Straight = 16,
33 Curve1 = 32,
34 Curve2 = 48,
35 Flexible = 128
36 }
37
22 public class PrimitiveBaseShape 38 public class PrimitiveBaseShape
23 { 39 {
24 private static byte[] m_defaultTextureEntry; 40 private static byte[] m_defaultTextureEntry;
@@ -59,7 +75,7 @@ namespace OpenSim.Framework.Types
59 } 75 }
60 } 76 }
61 77
62 public HollowShape HoleShape 78 public HollowShape HollowShape
63 { 79 {
64 get 80 get
65 { 81 {
@@ -87,6 +103,7 @@ namespace OpenSim.Framework.Types
87 103
88 public PrimitiveBaseShape() 104 public PrimitiveBaseShape()
89 { 105 {
106 PCode = (byte)PCodeEnum.Primitive;
90 ExtraParams = new byte[1]; 107 ExtraParams = new byte[1];
91 TextureEntry = m_defaultTextureEntry; 108 TextureEntry = m_defaultTextureEntry;
92 } 109 }
@@ -116,15 +133,14 @@ namespace OpenSim.Framework.Types
116 public BoxShape() 133 public BoxShape()
117 : base() 134 : base()
118 { 135 {
119 PathCurve = 16; 136 PathCurve = (byte) Extrusion.Straight;
120 ProfileShape = ProfileShape.Square; 137 ProfileShape = ProfileShape.Square;
121 PCode = 9;
122 PathScaleX = 100; 138 PathScaleX = 100;
123 PathScaleY = 100; 139 PathScaleY = 100;
124 } 140 }
125 141
126 public BoxShape(float side) 142 public BoxShape(float side)
127 : base() 143 : this()
128 { 144 {
129 SetSide(side); 145 SetSide(side);
130 } 146 }
@@ -151,15 +167,14 @@ namespace OpenSim.Framework.Types
151 public CylinderShape() 167 public CylinderShape()
152 : base() 168 : base()
153 { 169 {
154 PathCurve = 16; 170 PathCurve = (byte)Extrusion.Straight;
155 ProfileShape = ProfileShape.Circle; 171 ProfileShape = ProfileShape.Circle;
156 PCode = 9;
157 PathScaleX = 100; 172 PathScaleX = 100;
158 PathScaleY = 100; 173 PathScaleY = 100;
159 } 174 }
160 175
161 public CylinderShape(float radius, float heigth) 176 public CylinderShape(float radius, float heigth)
162 : base() 177 : this()
163 { 178 {
164 SetRadius(radius); 179 SetRadius(radius);
165 SetHeigth(heigth); 180 SetHeigth(heigth);
@@ -167,7 +182,7 @@ namespace OpenSim.Framework.Types
167 182
168 private void SetHeigth(float heigth) 183 private void SetHeigth(float heigth)
169 { 184 {
170 Scale.Y = heigth; 185 Scale.Z = heigth;
171 } 186 }
172 187
173 private void SetRadius(float radius) 188 private void SetRadius(float radius)
diff --git a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
index b21e4aa..b1da33a 100644
--- a/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/ComplexObject.cs
@@ -14,11 +14,12 @@ namespace SimpleApp
14 14
15 private class RotatingWheel : SceneObjectPart 15 private class RotatingWheel : SceneObjectPart
16 { 16 {
17 private static LLQuaternion m_rotationDirection = new LLQuaternion(0.05f, 0, 0); 17 private LLQuaternion m_rotationDirection;
18 18
19 public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition) 19 public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
20 : base(regionHandle, parent, ownerID, localID, BoxShape.Default, groupPosition, offsetPosition ) 20 : base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition )
21 { 21 {
22 m_rotationDirection = rotationDirection;
22 } 23 }
23 24
24 public override void UpdateMovement() 25 public override void UpdateMovement()
@@ -38,10 +39,16 @@ namespace SimpleApp
38 : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default ) 39 : base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default )
39 { 40 {
40 m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); 41 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 42
43 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), new LLQuaternion(0.05f,0,0)));
44 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), new LLQuaternion(-0.05f,0,0)));
45
46 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f,0), new LLQuaternion(0.5f, 0, 0.05f)));
47 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f,0), new LLQuaternion(-0.5f, 0, -0.05f)));
48
49 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), new LLQuaternion(0, 0.5f, 0.05f)));
50 AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), new LLQuaternion(0, -0.5f, -0.05f)));
51
45 UpdateParentIDs(); 52 UpdateParentIDs();
46 } 53 }
47 } 54 }