aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/General/Types/PrimitiveBaseShape.cs90
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs5
2 files changed, 53 insertions, 42 deletions
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
index 41a58fe..045569b 100644
--- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
@@ -3,27 +3,24 @@ using libsecondlife.Packets;
3 3
4namespace OpenSim.Framework.Types 4namespace OpenSim.Framework.Types
5{ 5{
6 //public enum ShapeType 6 public enum ProfileShape : byte
7 //{ 7 {
8 // Box, 8 Circle = 0,
9 // Sphere, 9 Square = 1,
10 // Ring, 10 IsometricTriangle = 2,
11 // Tube, 11 EquilateralTriangle = 3,
12 // Torus, 12 RightTriangle = 4,
13 // Prism, 13 HalfCircle = 5
14 // Scuplted, 14 }
15 // Cylinder,
16 // Foliage,
17 // Unknown
18 //}
19
20
21 15
22 public class PrimitiveBaseShape 16 public enum HollowShape : byte
23 { 17 {
24 //protected ShapeType m_type = ShapeType.Unknown; 18 Same = 0,
25 19 // Fill in...
20 }
26 21
22 public class PrimitiveBaseShape
23 {
27 private static byte[] m_defaultTextureEntry; 24 private static byte[] m_defaultTextureEntry;
28 25
29 public byte PCode; 26 public byte PCode;
@@ -49,13 +46,31 @@ namespace OpenSim.Framework.Types
49 public byte[] TextureEntry; // a LL textureEntry in byte[] format 46 public byte[] TextureEntry; // a LL textureEntry in byte[] format
50 public byte[] ExtraParams; 47 public byte[] ExtraParams;
51 48
52 //public ShapeType PrimType 49 public ProfileShape ProfileShape
53 //{ 50 {
54 // get 51 get
55 // { 52 {
56 // return this.m_type; 53 return (ProfileShape)(ProfileCurve & 0xf);
57 // } 54 }
58 //} 55 set
56 {
57 byte oldValueMasked = (byte)(ProfileCurve & 0xf0);
58 ProfileCurve = (byte)(oldValueMasked | (byte)value);
59 }
60 }
61
62 public HollowShape HoleShape
63 {
64 get
65 {
66 return (HollowShape)(ProfileHollow & 0xf0);
67 }
68 set
69 {
70 byte oldValueMasked = (byte)(ProfileHollow & 0xf0);
71 ProfileHollow = (byte)(oldValueMasked | (byte)value);
72 }
73 }
59 74
60 public LLVector3 PrimScale 75 public LLVector3 PrimScale
61 { 76 {
@@ -88,36 +103,29 @@ namespace OpenSim.Framework.Types
88 } 103 }
89 } 104 }
90 105
91 enum ProfileShape
92 {
93 Circle = 0,
94 Square = 1,
95 IsometricTriangle = 2,
96 EquilateralTriangle = 3,
97 RightTriangle = 4,
98 HalfCircle = 5
99 }
100
101 public class GenericShape : PrimitiveBaseShape 106 public class GenericShape : PrimitiveBaseShape
102 { 107 {
103
104 public GenericShape() : base() 108 public GenericShape() : base()
105 { 109 {
106 110
107 } 111 }
108 } 112 }
109 113
110 public class BoxShape : PrimitiveBaseShape 114 public class BoxShape : PrimitiveBaseShape
111 { 115 {
112 public BoxShape() : base() 116 public BoxShape() : base()
113 { 117 {
114 //m_type = ShapeType.Box;
115 PathCurve = 16; 118 PathCurve = 16;
116 ProfileCurve = 1; 119 ProfileShape = ProfileShape.Square;
117 PCode = 9; 120 PCode = 9;
118 PathScaleX = 100; 121 PathScaleX = 100;
119 PathScaleY = 100; 122 PathScaleY = 100;
120 } 123 }
124
125 public void SetSide( float side )
126 {
127 Scale = new LLVector3( side, side, side );
128 }
121 129
122 public static BoxShape Default 130 public static BoxShape Default
123 { 131 {
@@ -125,7 +133,7 @@ namespace OpenSim.Framework.Types
125 { 133 {
126 BoxShape boxShape = new BoxShape(); 134 BoxShape boxShape = new BoxShape();
127 135
128 boxShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 136 boxShape.SetSide( 0.5f );
129 137
130 return boxShape; 138 return boxShape;
131 } 139 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 50b0780..db71578 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -47,11 +47,14 @@ namespace SimpleApp
47 { 47 {
48 base.StartUp(); 48 base.StartUp();
49 49
50 m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache);
51
50 m_log.Notice(m_log.LineInfo); 52 m_log.Notice(m_log.LineInfo);
51 53
52 ScenePresence.PhysicsEngineFlying = true; 54 ScenePresence.PhysicsEngineFlying = true;
53 55
54 IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); 56 IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);
57
55 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); 58 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
56 regionInfo.DataStore = "simpleapp_datastore.yap"; 59 regionInfo.DataStore = "simpleapp_datastore.yap";
57 60
@@ -67,7 +70,7 @@ namespace SimpleApp
67 LLVector3 pos = new LLVector3(138, 129, 27); 70 LLVector3 pos = new LLVector3(138, 129, 27);
68 71
69 SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); 72 SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
70 scene.AddEntity(sceneObject); 73 scene.AddEntity(sceneObject);
71 74
72 MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager ); 75 MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager );
73 scene.AddNewClient(m_character, false); 76 scene.AddNewClient(m_character, false);