From 9800c05c1b3c7804466d6f3a9c38a739156625fd Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 17:26:33 +0000 Subject: Started change to having SceneObject and then that having child Primitives which in turn have a Shape object (currently PrimitiveBaseShape). The plan is only for the SceneObject to interface with the physics engines. As a physics Entity should be able to have mulitple shapes connected to it. --- .../Framework/General/Types/PrimitiveBaseShape.cs | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 OpenSim/Framework/General/Types/PrimitiveBaseShape.cs (limited to 'OpenSim/Framework/General/Types') diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs new file mode 100644 index 0000000..094a8a0 --- /dev/null +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; +using OpenSim.Framework.Interfaces; + +namespace OpenSim.Framework.Types +{ + public enum ShapeType + { + Box, + Sphere, + Ring, + Tube, + Torus, + Prism, + Scuplted, + Cylinder + } + + public class PrimitiveBaseShape + { + private ShapeType type; + + public byte PCode; + public ushort PathBegin; + public ushort PathEnd; + 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; + public byte ProfileCurve; + public uint ParentID = 0; + public ushort ProfileHollow; + public sbyte PathRadiusOffset; + public byte PathRevolutions; + public sbyte PathTaperX; + public sbyte PathTaperY; + public sbyte PathTwist; + public sbyte PathTwistBegin; + public byte[] TextureEntry; // a LL textureEntry in byte[] format + + public ShapeType PrimType + { + get + { + return this.type; + } + } + + public LLVector3 PrimScale + { + get + { + return this.Scale; + } + } + + public PrimitiveBaseShape() + { + + } + + //void returns need to change of course + public void GetMesh() + { + + } + + public static PrimitiveBaseShape DefaultCube() + { + PrimitiveBaseShape primShape = new PrimitiveBaseShape(); + + primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); + primShape.PCode = 9; + primShape.ParentID = 0; + primShape.PathBegin = 0; + primShape.PathEnd = 0; + primShape.PathScaleX = 0; + primShape.PathScaleY = 0; + primShape.PathShearX = 0; + primShape.PathShearY = 0; + primShape.PathSkew = 0; + primShape.ProfileBegin = 0; + primShape.ProfileEnd = 0; + primShape.PathCurve = 16; + primShape.ProfileCurve = 1; + primShape.ProfileHollow = 0; + primShape.PathRadiusOffset = 0; + primShape.PathRevolutions = 0; + primShape.PathTaperX = 0; + primShape.PathTaperY = 0; + primShape.PathTwist = 0; + primShape.PathTwistBegin = 0; + + return primShape; + } + } + +} -- cgit v1.1