From ed314e19ff759edd75e515017275465cf5ee3380 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 10 Jan 2008 11:17:26 +0000 Subject: * Sorted members for great justice --- OpenSim/Framework/PrimitiveBaseShape.cs | 108 ++++++++++++++++---------------- 1 file changed, 53 insertions(+), 55 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 91c589a..ff6b7f5 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -68,31 +68,46 @@ namespace OpenSim.Framework public class PrimitiveBaseShape { private static readonly LLObject.TextureEntry m_defaultTexture; + public byte[] ExtraParams; + private byte[] m_textureEntry; - public byte State; - public byte PCode; public ushort PathBegin; + public byte PathCurve; public ushort PathEnd; + public sbyte PathRadiusOffset; + public byte PathRevolutions; public byte PathScaleX; public byte PathScaleY; public byte PathShearX; public byte PathShearY; public sbyte PathSkew; - public ushort ProfileBegin; - public ushort ProfileEnd; - public LLVector3 Scale; - public byte PathCurve; - - [XmlIgnore] // -- this one is re-constructed from ProfileShape and ProfileHollow - public byte ProfileCurve; - - public ushort ProfileHollow; - public sbyte PathRadiusOffset; - public byte PathRevolutions; public sbyte PathTaperX; public sbyte PathTaperY; public sbyte PathTwist; public sbyte PathTwistBegin; + public byte PCode; + public ushort ProfileBegin; + + [XmlIgnore] // -- this one is re-constructed from ProfileShape and ProfileHollow + public byte ProfileCurve; + + public ushort ProfileEnd; + public ushort ProfileHollow; + public LLVector3 Scale; + public byte State; + + static PrimitiveBaseShape() + { + m_defaultTexture = + new LLObject.TextureEntry(new LLUUID("89556747-24cb-43ed-920b-47caed15465f")); + } + + public PrimitiveBaseShape() + { + PCode = (byte) PCodeEnum.Primitive; + ExtraParams = new byte[1]; + Textures = m_defaultTexture; + } [XmlIgnore] public LLObject.TextureEntry Textures @@ -102,8 +117,6 @@ namespace OpenSim.Framework set { m_textureEntry = value.ToBytes(); } } - private byte[] m_textureEntry; - public byte[] TextureEntry { get { return m_textureEntry; } @@ -111,25 +124,23 @@ namespace OpenSim.Framework set { m_textureEntry = value; } } - public byte[] ExtraParams; - public ProfileShape ProfileShape { - get { return (ProfileShape)(ProfileCurve & 0xf); } + get { return (ProfileShape) (ProfileCurve & 0xf); } set { - byte oldValueMasked = (byte)(ProfileCurve & 0xf0); - ProfileCurve = (byte)(oldValueMasked | (byte)value); + byte oldValueMasked = (byte) (ProfileCurve & 0xf0); + ProfileCurve = (byte) (oldValueMasked | (byte) value); } } public HollowShape HollowShape { - get { return (HollowShape)(ProfileCurve & 0xf0); } + get { return (HollowShape) (ProfileCurve & 0xf0); } set { - byte oldValueMasked = (byte)(ProfileCurve & 0x0f); - ProfileCurve = (byte)(oldValueMasked | (byte)value); + byte oldValueMasked = (byte) (ProfileCurve & 0x0f); + ProfileCurve = (byte) (oldValueMasked | (byte) value); } } @@ -138,20 +149,19 @@ namespace OpenSim.Framework get { return Scale; } } - - static PrimitiveBaseShape() + public static PrimitiveBaseShape Default { - m_defaultTexture = - new LLObject.TextureEntry(new LLUUID("89556747-24cb-43ed-920b-47caed15465f")); - } + get + { + PrimitiveBaseShape boxShape = CreateBox(); - public PrimitiveBaseShape() - { - PCode = (byte)PCodeEnum.Primitive; - ExtraParams = new byte[1]; - Textures = m_defaultTexture; + boxShape.SetScale(0.5f); + + return boxShape; + } } + public static PrimitiveBaseShape Create() { PrimitiveBaseShape shape = new PrimitiveBaseShape(); @@ -162,7 +172,7 @@ namespace OpenSim.Framework { PrimitiveBaseShape shape = Create(); - shape.PathCurve = (byte)Extrusion.Straight; + shape.PathCurve = (byte) Extrusion.Straight; shape.ProfileShape = ProfileShape.Square; shape.PathScaleX = 100; shape.PathScaleY = 100; @@ -174,7 +184,7 @@ namespace OpenSim.Framework { PrimitiveBaseShape shape = Create(); - shape.PathCurve = (byte)Extrusion.Curve1; + shape.PathCurve = (byte) Extrusion.Curve1; shape.ProfileShape = ProfileShape.Square; shape.PathScaleX = 100; @@ -183,18 +193,6 @@ namespace OpenSim.Framework return shape; } - public static PrimitiveBaseShape Default - { - get - { - PrimitiveBaseShape boxShape = CreateBox(); - - boxShape.SetScale(0.5f); - - return boxShape; - } - } - public void SetScale(float side) { Scale = new LLVector3(side, side, side); @@ -207,7 +205,7 @@ namespace OpenSim.Framework public void SetRadius(float radius) { - Scale.X = Scale.Y = radius * 2f; + Scale.X = Scale.Y = radius*2f; } //void returns need to change of course @@ -217,29 +215,29 @@ namespace OpenSim.Framework public PrimitiveBaseShape Copy() { - return (PrimitiveBaseShape)MemberwiseClone(); + return (PrimitiveBaseShape) MemberwiseClone(); } public static PrimitiveBaseShape CreateCylinder(float radius, float heigth) { - PrimitiveBaseShape shape = CreateCylinder( ); + PrimitiveBaseShape shape = CreateCylinder(); - shape.SetHeigth( heigth ); - shape.SetRadius( radius ); + shape.SetHeigth(heigth); + shape.SetRadius(radius); return shape; } - public void SetPathRange( LLVector3 pathRange ) + public void SetPathRange(LLVector3 pathRange) { PathBegin = LLObject.PackBeginCut(pathRange.X); PathEnd = LLObject.PackEndCut(pathRange.Y); } - public void SetProfileRange( LLVector3 profileRange ) + public void SetProfileRange(LLVector3 profileRange) { ProfileBegin = LLObject.PackBeginCut(profileRange.X); ProfileEnd = LLObject.PackEndCut(profileRange.Y); } } -} +} \ No newline at end of file -- cgit v1.1