aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/PrimitiveBaseShape.cs
diff options
context:
space:
mode:
authorMW2007-10-29 21:46:25 +0000
committerMW2007-10-29 21:46:25 +0000
commit3d8219f6c7faa256d6a13ab7925f75d83af95b78 (patch)
treeea507efa88aa7e526575469a6ce913fdc0c0358e /OpenSim/Framework/General/PrimitiveBaseShape.cs
parentFixed a bug in SQLAssetServer that only seemed to be a problem when running u... (diff)
downloadopensim-SC-3d8219f6c7faa256d6a13ab7925f75d83af95b78.zip
opensim-SC-3d8219f6c7faa256d6a13ab7925f75d83af95b78.tar.gz
opensim-SC-3d8219f6c7faa256d6a13ab7925f75d83af95b78.tar.bz2
opensim-SC-3d8219f6c7faa256d6a13ab7925f75d83af95b78.tar.xz
as per the "Filesystem cleanup for OpenSim repository" mailing list thread. Have flattened the OpenSim.Framework project/namespace. The problem is that the namespace is still wrong as its "OpenSim.Framework" while the directory is "OpenSim\Framework\General" , so we need to decide if we change the directory or correct the namespace.
Note this has lead to a big flat project, but I think a lot of the files we most likely don't even use any longer. And others belong in other projects/namespaces anyway.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/PrimitiveBaseShape.cs (renamed from OpenSim/Framework/General/Types/PrimitiveBaseShape.cs)448
1 files changed, 224 insertions, 224 deletions
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/PrimitiveBaseShape.cs
index 5805ece..1799fb8 100644
--- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/General/PrimitiveBaseShape.cs
@@ -1,224 +1,224 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29using System.Xml.Serialization; 29using System.Xml.Serialization;
30using libsecondlife; 30using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32 32
33namespace OpenSim.Framework.Types 33namespace OpenSim.Framework
34{ 34{
35 public enum ProfileShape : byte 35 public enum ProfileShape : byte
36 { 36 {
37 Circle = 0, 37 Circle = 0,
38 Square = 1, 38 Square = 1,
39 IsometricTriangle = 2, 39 IsometricTriangle = 2,
40 EquilateralTriangle = 3, 40 EquilateralTriangle = 3,
41 RightTriangle = 4, 41 RightTriangle = 4,
42 HalfCircle = 5 42 HalfCircle = 5
43 } 43 }
44 44
45 public enum HollowShape : byte 45 public enum HollowShape : byte
46 { 46 {
47 Same = 0, 47 Same = 0,
48 Circle = 16, 48 Circle = 16,
49 Square = 32, 49 Square = 32,
50 Triangle = 48 50 Triangle = 48
51 } 51 }
52 52
53 public enum PCodeEnum : byte 53 public enum PCodeEnum : byte
54 { 54 {
55 Primitive = 9, 55 Primitive = 9,
56 Avatar = 47 56 Avatar = 47
57 } 57 }
58 58
59 public enum Extrusion : byte 59 public enum Extrusion : byte
60 { 60 {
61 Straight = 16, 61 Straight = 16,
62 Curve1 = 32, 62 Curve1 = 32,
63 Curve2 = 48, 63 Curve2 = 48,
64 Flexible = 128 64 Flexible = 128
65 } 65 }
66 66
67 public class PrimitiveBaseShape 67 public class PrimitiveBaseShape
68 { 68 {
69 private static byte[] m_defaultTextureEntry; 69 private static byte[] m_defaultTextureEntry;
70 70
71 public byte PCode; 71 public byte PCode;
72 public ushort PathBegin; 72 public ushort PathBegin;
73 public ushort PathEnd; 73 public ushort PathEnd;
74 public byte PathScaleX; 74 public byte PathScaleX;
75 public byte PathScaleY; 75 public byte PathScaleY;
76 public byte PathShearX; 76 public byte PathShearX;
77 public byte PathShearY; 77 public byte PathShearY;
78 public sbyte PathSkew; 78 public sbyte PathSkew;
79 public ushort ProfileBegin; 79 public ushort ProfileBegin;
80 public ushort ProfileEnd; 80 public ushort ProfileEnd;
81 public LLVector3 Scale; 81 public LLVector3 Scale;
82 public byte PathCurve; 82 public byte PathCurve;
83 public byte ProfileCurve; 83 public byte ProfileCurve;
84 public ushort ProfileHollow; 84 public ushort ProfileHollow;
85 public sbyte PathRadiusOffset; 85 public sbyte PathRadiusOffset;
86 public byte PathRevolutions; 86 public byte PathRevolutions;
87 public sbyte PathTaperX; 87 public sbyte PathTaperX;
88 public sbyte PathTaperY; 88 public sbyte PathTaperY;
89 public sbyte PathTwist; 89 public sbyte PathTwist;
90 public sbyte PathTwistBegin; 90 public sbyte PathTwistBegin;
91 public byte[] TextureEntry; // a LL textureEntry in byte[] format 91 public byte[] TextureEntry; // a LL textureEntry in byte[] format
92 public byte[] ExtraParams; 92 public byte[] ExtraParams;
93 93
94 public ProfileShape ProfileShape 94 public ProfileShape ProfileShape
95 { 95 {
96 get 96 get
97 { 97 {
98 return (ProfileShape)(ProfileCurve & 0xf); 98 return (ProfileShape)(ProfileCurve & 0xf);
99 } 99 }
100 set 100 set
101 { 101 {
102 byte oldValueMasked = (byte)(ProfileCurve & 0xf0); 102 byte oldValueMasked = (byte)(ProfileCurve & 0xf0);
103 ProfileCurve = (byte)(oldValueMasked | (byte)value); 103 ProfileCurve = (byte)(oldValueMasked | (byte)value);
104 } 104 }
105 } 105 }
106 106
107 [XmlIgnore] 107 [XmlIgnore]
108 public HollowShape HollowShape 108 public HollowShape HollowShape
109 { 109 {
110 get 110 get
111 { 111 {
112 return (HollowShape)(ProfileHollow & 0xf0); 112 return (HollowShape)(ProfileHollow & 0xf0);
113 } 113 }
114 set 114 set
115 { 115 {
116 byte oldValueMasked = (byte)(ProfileHollow & 0xf0); 116 byte oldValueMasked = (byte)(ProfileHollow & 0xf0);
117 ProfileHollow = (byte)(oldValueMasked | (byte)value); 117 ProfileHollow = (byte)(oldValueMasked | (byte)value);
118 } 118 }
119 } 119 }
120 120
121 public LLVector3 PrimScale 121 public LLVector3 PrimScale
122 { 122 {
123 get 123 get
124 { 124 {
125 return this.Scale; 125 return this.Scale;
126 } 126 }
127 } 127 }
128 128
129 static PrimitiveBaseShape() 129 static PrimitiveBaseShape()
130 { 130 {
131 m_defaultTextureEntry = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes(); 131 m_defaultTextureEntry = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes();
132 } 132 }
133 133
134 public PrimitiveBaseShape() 134 public PrimitiveBaseShape()
135 { 135 {
136 PCode = (byte)PCodeEnum.Primitive; 136 PCode = (byte)PCodeEnum.Primitive;
137 ExtraParams = new byte[1]; 137 ExtraParams = new byte[1];
138 TextureEntry = m_defaultTextureEntry; 138 TextureEntry = m_defaultTextureEntry;
139 } 139 }
140 140
141 //void returns need to change of course 141 //void returns need to change of course
142 public virtual void GetMesh() 142 public virtual void GetMesh()
143 { 143 {
144 144
145 } 145 }
146 146
147 public PrimitiveBaseShape Copy() 147 public PrimitiveBaseShape Copy()
148 { 148 {
149 return (PrimitiveBaseShape)this.MemberwiseClone(); 149 return (PrimitiveBaseShape)this.MemberwiseClone();
150 } 150 }
151 } 151 }
152 152
153 public class GenericShape : PrimitiveBaseShape 153 public class GenericShape : PrimitiveBaseShape
154 { 154 {
155 public GenericShape() 155 public GenericShape()
156 : base() 156 : base()
157 { 157 {
158 158
159 } 159 }
160 } 160 }
161 161
162 public class BoxShape : PrimitiveBaseShape 162 public class BoxShape : PrimitiveBaseShape
163 { 163 {
164 public BoxShape() 164 public BoxShape()
165 : base() 165 : base()
166 { 166 {
167 PathCurve = (byte)Extrusion.Straight; 167 PathCurve = (byte)Extrusion.Straight;
168 ProfileShape = ProfileShape.Square; 168 ProfileShape = ProfileShape.Square;
169 PathScaleX = 100; 169 PathScaleX = 100;
170 PathScaleY = 100; 170 PathScaleY = 100;
171 } 171 }
172 172
173 public BoxShape(float side) 173 public BoxShape(float side)
174 : this() 174 : this()
175 { 175 {
176 SetSide(side); 176 SetSide(side);
177 } 177 }
178 178
179 public void SetSide(float side) 179 public void SetSide(float side)
180 { 180 {
181 Scale = new LLVector3(side, side, side); 181 Scale = new LLVector3(side, side, side);
182 } 182 }
183 183
184 public static BoxShape Default 184 public static BoxShape Default
185 { 185 {
186 get 186 get
187 { 187 {
188 BoxShape boxShape = new BoxShape(); 188 BoxShape boxShape = new BoxShape();
189 189
190 boxShape.SetSide(0.5f); 190 boxShape.SetSide(0.5f);
191 191
192 return boxShape; 192 return boxShape;
193 } 193 }
194 } 194 }
195 } 195 }
196 public class CylinderShape : PrimitiveBaseShape 196 public class CylinderShape : PrimitiveBaseShape
197 { 197 {
198 public CylinderShape() 198 public CylinderShape()
199 : base() 199 : base()
200 { 200 {
201 PathCurve = (byte)Extrusion.Straight; 201 PathCurve = (byte)Extrusion.Straight;
202 ProfileShape = ProfileShape.Circle; 202 ProfileShape = ProfileShape.Circle;
203 PathScaleX = 100; 203 PathScaleX = 100;
204 PathScaleY = 100; 204 PathScaleY = 100;
205 } 205 }
206 206
207 public CylinderShape(float radius, float heigth) 207 public CylinderShape(float radius, float heigth)
208 : this() 208 : this()
209 { 209 {
210 SetRadius(radius); 210 SetRadius(radius);
211 SetHeigth(heigth); 211 SetHeigth(heigth);
212 } 212 }
213 213
214 private void SetHeigth(float heigth) 214 private void SetHeigth(float heigth)
215 { 215 {
216 Scale.Z = heigth; 216 Scale.Z = heigth;
217 } 217 }
218 218
219 private void SetRadius(float radius) 219 private void SetRadius(float radius)
220 { 220 {
221 Scale.X = Scale.Y = radius * 2f; 221 Scale.X = Scale.Y = radius * 2f;
222 } 222 }
223 } 223 }
224} 224}