aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
blob: 1844caa74111cb30597be16271b4e861733a213b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using libsecondlife;
using libsecondlife.Packets;

namespace OpenSim.Framework.Types
{
    public enum ShapeType
    {
        Box,
        Sphere,
        Ring,
        Tube,
        Torus,
        Prism,
        Scuplted,
        Cylinder,
        Foliage,
        Unknown
    }

    public class PrimitiveBaseShape
    {
        private ShapeType type = ShapeType.Unknown;

        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 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 PrimitiveBaseShape Copy()
        {
            return (PrimitiveBaseShape) this.MemberwiseClone();
        }

        public static PrimitiveBaseShape DefaultBox()
        {
            PrimitiveBaseShape primShape = new PrimitiveBaseShape();

            primShape.type = ShapeType.Box;
            primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
            primShape.PCode = 9;
            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;
        }
    }
}