* a very small first step with shape wrappers

afrisby
lbsa71 2007-08-03 20:21:53 +00:00
parent a6aea50eac
commit 6dabab5ef0
1 changed files with 26 additions and 37 deletions

View File

@ -3,23 +3,23 @@ using libsecondlife.Packets;
namespace OpenSim.Framework.Types namespace OpenSim.Framework.Types
{ {
public enum ShapeType //public enum ShapeType
{ //{
Box, // Box,
Sphere, // Sphere,
Ring, // Ring,
Tube, // Tube,
Torus, // Torus,
Prism, // Prism,
Scuplted, // Scuplted,
Cylinder, // Cylinder,
Foliage, // Foliage,
Unknown // Unknown
} //}
public class PrimitiveBaseShape public class PrimitiveBaseShape
{ {
protected ShapeType type = ShapeType.Unknown; //protected ShapeType m_type = ShapeType.Unknown;
public byte PCode; public byte PCode;
public ushort PathBegin; public ushort PathBegin;
@ -44,13 +44,13 @@ namespace OpenSim.Framework.Types
public byte[] TextureEntry; // a LL textureEntry in byte[] format public byte[] TextureEntry; // a LL textureEntry in byte[] format
public byte[] ExtraParams; public byte[] ExtraParams;
public ShapeType PrimType //public ShapeType PrimType
{ //{
get // get
{ // {
return this.type; // return this.m_type;
} // }
} //}
public LLVector3 PrimScale public LLVector3 PrimScale
{ {
@ -79,10 +79,12 @@ namespace OpenSim.Framework.Types
public class BoxShape : PrimitiveBaseShape public class BoxShape : PrimitiveBaseShape
{ {
public BoxShape() public BoxShape() : base()
{ {
type = ShapeType.Box; //m_type = ShapeType.Box;
ExtraParams = new byte[1]; PathCurve = 16;
ProfileCurve = 1;
PCode = 9;
} }
public static BoxShape Default public static BoxShape Default
@ -92,7 +94,6 @@ namespace OpenSim.Framework.Types
BoxShape primShape = new BoxShape(); BoxShape primShape = new BoxShape();
primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
primShape.PCode = 9;
primShape.PathBegin = 0; primShape.PathBegin = 0;
primShape.PathEnd = 0; primShape.PathEnd = 0;
primShape.PathScaleX = 0; primShape.PathScaleX = 0;
@ -102,8 +103,6 @@ namespace OpenSim.Framework.Types
primShape.PathSkew = 0; primShape.PathSkew = 0;
primShape.ProfileBegin = 0; primShape.ProfileBegin = 0;
primShape.ProfileEnd = 0; primShape.ProfileEnd = 0;
primShape.PathCurve = 16;
primShape.ProfileCurve = 1;
primShape.ProfileHollow = 0; primShape.ProfileHollow = 0;
primShape.PathRadiusOffset = 0; primShape.PathRadiusOffset = 0;
primShape.PathRevolutions = 0; primShape.PathRevolutions = 0;
@ -113,19 +112,9 @@ namespace OpenSim.Framework.Types
primShape.PathTwistBegin = 0; primShape.PathTwistBegin = 0;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
primShape.TextureEntry = ntex.ToBytes(); primShape.TextureEntry = ntex.ToBytes();
primShape.ExtraParams = new byte[1];
return primShape; return primShape;
} }
} }
} }
public class SphereShape : PrimitiveBaseShape
{
public SphereShape()
{
type = ShapeType.Sphere;
ExtraParams = new byte[1];
}
}
} }