PrimitiveBaseShape.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using libsecondlife;
  2. using libsecondlife.Packets;
  3. namespace OpenSim.Framework.Types
  4. {
  5. public enum ShapeType
  6. {
  7. Box,
  8. Sphere,
  9. Ring,
  10. Tube,
  11. Torus,
  12. Prism,
  13. Scuplted,
  14. Cylinder,
  15. Foliage,
  16. Unknown
  17. }
  18. public class PrimitiveBaseShape
  19. {
  20. private ShapeType type = ShapeType.Unknown;
  21. public byte PCode;
  22. public ushort PathBegin;
  23. public ushort PathEnd;
  24. public byte PathScaleX;
  25. public byte PathScaleY;
  26. public byte PathShearX;
  27. public byte PathShearY;
  28. public sbyte PathSkew;
  29. public ushort ProfileBegin;
  30. public ushort ProfileEnd;
  31. public LLVector3 Scale;
  32. public byte PathCurve;
  33. public byte ProfileCurve;
  34. public ushort ProfileHollow;
  35. public sbyte PathRadiusOffset;
  36. public byte PathRevolutions;
  37. public sbyte PathTaperX;
  38. public sbyte PathTaperY;
  39. public sbyte PathTwist;
  40. public sbyte PathTwistBegin;
  41. public byte[] TextureEntry; // a LL textureEntry in byte[] format
  42. public ShapeType PrimType
  43. {
  44. get
  45. {
  46. return this.type;
  47. }
  48. }
  49. public LLVector3 PrimScale
  50. {
  51. get
  52. {
  53. return this.Scale;
  54. }
  55. }
  56. public PrimitiveBaseShape()
  57. {
  58. }
  59. //void returns need to change of course
  60. public void GetMesh()
  61. {
  62. }
  63. public PrimitiveBaseShape Copy()
  64. {
  65. return (PrimitiveBaseShape) this.MemberwiseClone();
  66. }
  67. public static PrimitiveBaseShape DefaultBox()
  68. {
  69. PrimitiveBaseShape primShape = new PrimitiveBaseShape();
  70. primShape.type = ShapeType.Box;
  71. primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
  72. primShape.PCode = 9;
  73. primShape.PathBegin = 0;
  74. primShape.PathEnd = 0;
  75. primShape.PathScaleX = 0;
  76. primShape.PathScaleY = 0;
  77. primShape.PathShearX = 0;
  78. primShape.PathShearY = 0;
  79. primShape.PathSkew = 0;
  80. primShape.ProfileBegin = 0;
  81. primShape.ProfileEnd = 0;
  82. primShape.PathCurve = 16;
  83. primShape.ProfileCurve = 1;
  84. primShape.ProfileHollow = 0;
  85. primShape.PathRadiusOffset = 0;
  86. primShape.PathRevolutions = 0;
  87. primShape.PathTaperX = 0;
  88. primShape.PathTaperY = 0;
  89. primShape.PathTwist = 0;
  90. primShape.PathTwistBegin = 0;
  91. LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
  92. primShape.TextureEntry = ntex.ToBytes();
  93. return primShape;
  94. }
  95. }
  96. }