diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index b88f162..1208b97 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -186,40 +186,44 @@ namespace OpenSim.Framework | |||
186 | PCode = (byte)PCodeEnum.Primitive; | 186 | PCode = (byte)PCodeEnum.Primitive; |
187 | ExtraParams = new byte[1]; | 187 | ExtraParams = new byte[1]; |
188 | m_textureEntry = DEFAULT_TEXTURE; | 188 | m_textureEntry = DEFAULT_TEXTURE; |
189 | } | 189 | } |
190 | 190 | ||
191 | public PrimitiveBaseShape(Primitive prim) | 191 | /// <summary> |
192 | { | 192 | /// Construct a PrimitiveBaseShape object from a OpenMetaverse.Primitive object |
193 | PCode = (byte)prim.PrimData.PCode; | 193 | /// </summary> |
194 | ExtraParams = new byte[1]; | 194 | /// <param name="prim"></param> |
195 | 195 | public PrimitiveBaseShape(Primitive prim) | |
196 | State = prim.PrimData.State; | 196 | { |
197 | PathBegin = Primitive.PackBeginCut(prim.PrimData.PathBegin); | 197 | PCode = (byte)prim.PrimData.PCode; |
198 | PathEnd = Primitive.PackEndCut(prim.PrimData.PathEnd); | 198 | ExtraParams = new byte[1]; |
199 | PathScaleX = Primitive.PackPathScale(prim.PrimData.PathScaleX); | 199 | |
200 | PathScaleY = Primitive.PackPathScale(prim.PrimData.PathScaleY); | 200 | State = prim.PrimData.State; |
201 | PathShearX = (byte)Primitive.PackPathShear(prim.PrimData.PathShearX); | 201 | PathBegin = Primitive.PackBeginCut(prim.PrimData.PathBegin); |
202 | PathShearY = (byte)Primitive.PackPathShear(prim.PrimData.PathShearY); | 202 | PathEnd = Primitive.PackEndCut(prim.PrimData.PathEnd); |
203 | PathSkew = Primitive.PackPathTwist(prim.PrimData.PathSkew); | 203 | PathScaleX = Primitive.PackPathScale(prim.PrimData.PathScaleX); |
204 | ProfileBegin = Primitive.PackBeginCut(prim.PrimData.ProfileBegin); | 204 | PathScaleY = Primitive.PackPathScale(prim.PrimData.PathScaleY); |
205 | ProfileEnd = Primitive.PackEndCut(prim.PrimData.ProfileEnd); | 205 | PathShearX = (byte)Primitive.PackPathShear(prim.PrimData.PathShearX); |
206 | Scale = prim.Scale; | 206 | PathShearY = (byte)Primitive.PackPathShear(prim.PrimData.PathShearY); |
207 | PathCurve = (byte)prim.PrimData.PathCurve; | 207 | PathSkew = Primitive.PackPathTwist(prim.PrimData.PathSkew); |
208 | ProfileCurve = (byte)prim.PrimData.ProfileCurve; | 208 | ProfileBegin = Primitive.PackBeginCut(prim.PrimData.ProfileBegin); |
209 | ProfileHollow = Primitive.PackProfileHollow(prim.PrimData.ProfileHollow); | 209 | ProfileEnd = Primitive.PackEndCut(prim.PrimData.ProfileEnd); |
210 | PathRadiusOffset = Primitive.PackPathTwist(prim.PrimData.PathRadiusOffset); | 210 | Scale = prim.Scale; |
211 | PathRevolutions = Primitive.PackPathRevolutions(prim.PrimData.PathRevolutions); | 211 | PathCurve = (byte)prim.PrimData.PathCurve; |
212 | PathTaperX = Primitive.PackPathTaper(prim.PrimData.PathTaperX); | 212 | ProfileCurve = (byte)prim.PrimData.ProfileCurve; |
213 | PathTaperY = Primitive.PackPathTaper(prim.PrimData.PathTaperY); | 213 | ProfileHollow = Primitive.PackProfileHollow(prim.PrimData.ProfileHollow); |
214 | PathTwist = Primitive.PackPathTwist(prim.PrimData.PathTwist); | 214 | PathRadiusOffset = Primitive.PackPathTwist(prim.PrimData.PathRadiusOffset); |
215 | PathTwistBegin = Primitive.PackPathTwist(prim.PrimData.PathTwistBegin); | 215 | PathRevolutions = Primitive.PackPathRevolutions(prim.PrimData.PathRevolutions); |
216 | 216 | PathTaperX = Primitive.PackPathTaper(prim.PrimData.PathTaperX); | |
217 | m_textureEntry = prim.Textures.GetBytes(); | 217 | PathTaperY = Primitive.PackPathTaper(prim.PrimData.PathTaperY); |
218 | 218 | PathTwist = Primitive.PackPathTwist(prim.PrimData.PathTwist); | |
219 | SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None); | 219 | PathTwistBegin = Primitive.PackPathTwist(prim.PrimData.PathTwistBegin); |
220 | SculptData = prim.Sculpt.GetBytes(); | 220 | |
221 | SculptTexture = prim.Sculpt.SculptTexture; | 221 | m_textureEntry = prim.Textures.GetBytes(); |
222 | SculptType = (byte)prim.Sculpt.Type; | 222 | |
223 | SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None); | ||
224 | SculptData = prim.Sculpt.GetBytes(); | ||
225 | SculptTexture = prim.Sculpt.SculptTexture; | ||
226 | SculptType = (byte)prim.Sculpt.Type; | ||
223 | } | 227 | } |
224 | 228 | ||
225 | [XmlIgnore] | 229 | [XmlIgnore] |
@@ -227,8 +231,12 @@ namespace OpenSim.Framework | |||
227 | { | 231 | { |
228 | get | 232 | get |
229 | { | 233 | { |
230 | //m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); | 234 | //m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); |
231 | return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); | 235 | try { return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); } |
236 | catch { } | ||
237 | |||
238 | m_log.Warn("[SHAPE]: Failed to decode texture, length=" + ((m_textureEntry != null) ? m_textureEntry.Length : 0)); | ||
239 | return new Primitive.TextureEntry(null); | ||
232 | } | 240 | } |
233 | 241 | ||
234 | set { m_textureEntry = value.GetBytes(); } | 242 | set { m_textureEntry = value.GetBytes(); } |