diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 101 |
1 files changed, 56 insertions, 45 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 5894ab0..d393b62 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -25,10 +25,10 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using Axiom.Math; | ||
29 | using OpenSim.Framework; | ||
30 | using System; | 28 | using System; |
31 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Axiom.Math; | ||
31 | using OpenSim.Framework; | ||
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.Manager | 33 | namespace OpenSim.Region.Physics.Manager |
34 | { | 34 | { |
@@ -37,14 +37,16 @@ namespace OpenSim.Region.Physics.Manager | |||
37 | public delegate void VelocityUpdate(PhysicsVector velocity); | 37 | public delegate void VelocityUpdate(PhysicsVector velocity); |
38 | 38 | ||
39 | public delegate void OrientationUpdate(Quaternion orientation); | 39 | public delegate void OrientationUpdate(Quaternion orientation); |
40 | |||
40 | public enum ActorTypes : int | 41 | public enum ActorTypes : int |
41 | { | 42 | { |
42 | Unknown = 0, | 43 | Unknown = 0, |
43 | Agent = 1, | 44 | Agent = 1, |
44 | Prim = 2, | 45 | Prim = 2, |
45 | Ground = 3 | 46 | Ground = 3 |
46 | } | 47 | } |
47 | public class CollisionEventUpdate : EventArgs | 48 | |
49 | public class CollisionEventUpdate : EventArgs | ||
48 | { | 50 | { |
49 | // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. | 51 | // Raising the event on the object, so don't need to provide location.. further up the tree knows that info. |
50 | 52 | ||
@@ -53,52 +55,53 @@ namespace OpenSim.Region.Physics.Manager | |||
53 | public bool m_startOrEnd; | 55 | public bool m_startOrEnd; |
54 | //public uint m_LocalID; | 56 | //public uint m_LocalID; |
55 | public List<uint> m_objCollisionList; | 57 | public List<uint> m_objCollisionList; |
58 | |||
56 | public CollisionEventUpdate(uint localID, int colliderType, bool startOrEnd, List<uint> objCollisionList) | 59 | public CollisionEventUpdate(uint localID, int colliderType, bool startOrEnd, List<uint> objCollisionList) |
57 | { | 60 | { |
58 | m_colliderType = colliderType; | 61 | m_colliderType = colliderType; |
59 | m_startOrEnd = startOrEnd; | 62 | m_startOrEnd = startOrEnd; |
60 | m_objCollisionList = objCollisionList; | 63 | m_objCollisionList = objCollisionList; |
61 | |||
62 | } | 64 | } |
63 | public CollisionEventUpdate(bool startOrEnd){ | 65 | |
64 | m_colliderType = (int)ActorTypes.Unknown; | 66 | public CollisionEventUpdate(bool startOrEnd) |
67 | { | ||
68 | m_colliderType = (int) ActorTypes.Unknown; | ||
65 | m_startOrEnd = startOrEnd; | 69 | m_startOrEnd = startOrEnd; |
66 | m_objCollisionList = null; | 70 | m_objCollisionList = null; |
67 | } | 71 | } |
68 | public CollisionEventUpdate() { | 72 | |
69 | m_colliderType = (int)ActorTypes.Unknown; | 73 | public CollisionEventUpdate() |
74 | { | ||
75 | m_colliderType = (int) ActorTypes.Unknown; | ||
70 | m_startOrEnd = false; | 76 | m_startOrEnd = false; |
71 | m_objCollisionList = null; | 77 | m_objCollisionList = null; |
72 | } | 78 | } |
73 | public int collidertype{ | 79 | |
74 | get { | 80 | public int collidertype |
75 | return m_colliderType; | 81 | { |
76 | } | 82 | get { return m_colliderType; } |
77 | set { | 83 | set { m_colliderType = value; } |
78 | m_colliderType = value; | ||
79 | } | ||
80 | } | 84 | } |
81 | public bool startOrEnd { | 85 | |
82 | get { | 86 | public bool startOrEnd |
83 | return m_startOrEnd; | 87 | { |
84 | } | 88 | get { return m_startOrEnd; } |
85 | set { | 89 | set { m_startOrEnd = value; } |
86 | m_startOrEnd = value; | ||
87 | } | ||
88 | } | 90 | } |
89 | public void addCollider(uint localID) { | 91 | |
92 | public void addCollider(uint localID) | ||
93 | { | ||
90 | m_objCollisionList.Add(localID); | 94 | m_objCollisionList.Add(localID); |
91 | } | 95 | } |
92 | } | 96 | } |
93 | |||
94 | |||
95 | 97 | ||
96 | |||
97 | 98 | ||
98 | public abstract class PhysicsActor | 99 | public abstract class PhysicsActor |
99 | { | 100 | { |
100 | public delegate void RequestTerseUpdate(); | 101 | public delegate void RequestTerseUpdate(); |
102 | |||
101 | public delegate void CollisionUpdate(EventArgs e); | 103 | public delegate void CollisionUpdate(EventArgs e); |
104 | |||
102 | public delegate void OutOfBounds(PhysicsVector pos); | 105 | public delegate void OutOfBounds(PhysicsVector pos); |
103 | 106 | ||
104 | #pragma warning disable 67 | 107 | #pragma warning disable 67 |
@@ -117,10 +120,8 @@ namespace OpenSim.Region.Physics.Manager | |||
117 | 120 | ||
118 | public abstract PhysicsVector Size { get; set; } | 121 | public abstract PhysicsVector Size { get; set; } |
119 | 122 | ||
120 | public abstract PrimitiveBaseShape Shape | 123 | public abstract PrimitiveBaseShape Shape { set; } |
121 | { | 124 | |
122 | set; | ||
123 | } | ||
124 | public virtual void RequestPhysicsterseUpdate() | 125 | public virtual void RequestPhysicsterseUpdate() |
125 | { | 126 | { |
126 | // Make a temporary copy of the event to avoid possibility of | 127 | // Make a temporary copy of the event to avoid possibility of |
@@ -131,8 +132,8 @@ namespace OpenSim.Region.Physics.Manager | |||
131 | { | 132 | { |
132 | OnRequestTerseUpdate(); | 133 | OnRequestTerseUpdate(); |
133 | } | 134 | } |
134 | |||
135 | } | 135 | } |
136 | |||
136 | public virtual void RaiseOutOfBounds(PhysicsVector pos) | 137 | public virtual void RaiseOutOfBounds(PhysicsVector pos) |
137 | { | 138 | { |
138 | // Make a temporary copy of the event to avoid possibility of | 139 | // Make a temporary copy of the event to avoid possibility of |
@@ -143,8 +144,8 @@ namespace OpenSim.Region.Physics.Manager | |||
143 | { | 144 | { |
144 | OnOutOfBounds(pos); | 145 | OnOutOfBounds(pos); |
145 | } | 146 | } |
146 | |||
147 | } | 147 | } |
148 | |||
148 | public virtual void SendCollisionUpdate(EventArgs e) | 149 | public virtual void SendCollisionUpdate(EventArgs e) |
149 | { | 150 | { |
150 | CollisionUpdate handler = OnCollisionUpdate; | 151 | CollisionUpdate handler = OnCollisionUpdate; |
@@ -159,7 +160,7 @@ namespace OpenSim.Region.Physics.Manager | |||
159 | 160 | ||
160 | public abstract float Mass { get; } | 161 | public abstract float Mass { get; } |
161 | 162 | ||
162 | public abstract PhysicsVector Force { get;} | 163 | public abstract PhysicsVector Force { get; } |
163 | 164 | ||
164 | public abstract PhysicsVector GeometricCenter { get; } | 165 | public abstract PhysicsVector GeometricCenter { get; } |
165 | 166 | ||
@@ -172,7 +173,7 @@ namespace OpenSim.Region.Physics.Manager | |||
172 | public abstract Quaternion Orientation { get; set; } | 173 | public abstract Quaternion Orientation { get; set; } |
173 | public abstract int PhysicsActorType { get; set; } | 174 | public abstract int PhysicsActorType { get; set; } |
174 | 175 | ||
175 | public abstract bool IsPhysical {get; set;} | 176 | public abstract bool IsPhysical { get; set; } |
176 | 177 | ||
177 | public abstract bool Flying { get; set; } | 178 | public abstract bool Flying { get; set; } |
178 | public abstract bool SetAlwaysRun { get; set; } | 179 | public abstract bool SetAlwaysRun { get; set; } |
@@ -198,48 +199,54 @@ namespace OpenSim.Region.Physics.Manager | |||
198 | get { return PhysicsVector.Zero; } | 199 | get { return PhysicsVector.Zero; } |
199 | set { return; } | 200 | set { return; } |
200 | } | 201 | } |
202 | |||
201 | public override bool SetAlwaysRun | 203 | public override bool SetAlwaysRun |
202 | { | 204 | { |
203 | get { return false; } | 205 | get { return false; } |
204 | set { return; } | 206 | set { return; } |
205 | } | 207 | } |
208 | |||
206 | public override bool CollidingGround | 209 | public override bool CollidingGround |
207 | { | 210 | { |
208 | get {return false;} | 211 | get { return false; } |
209 | set {return;} | 212 | set { return; } |
210 | } | 213 | } |
211 | public override bool CollidingObj | 214 | |
215 | public override bool CollidingObj | ||
212 | { | 216 | { |
213 | get { return false; } | 217 | get { return false; } |
214 | set { return; } | 218 | set { return; } |
215 | } | 219 | } |
220 | |||
216 | public override PhysicsVector Size | 221 | public override PhysicsVector Size |
217 | { | 222 | { |
218 | get { return PhysicsVector.Zero; } | 223 | get { return PhysicsVector.Zero; } |
219 | set { return; } | 224 | set { return; } |
220 | } | 225 | } |
226 | |||
221 | public override float Mass | 227 | public override float Mass |
222 | { | 228 | { |
223 | get { return 0f; } | 229 | get { return 0f; } |
224 | } | 230 | } |
231 | |||
225 | public override PhysicsVector Force | 232 | public override PhysicsVector Force |
226 | { | 233 | { |
227 | get { return PhysicsVector.Zero; } | 234 | get { return PhysicsVector.Zero; } |
228 | } | 235 | } |
236 | |||
229 | public override PhysicsVector CenterOfMass | 237 | public override PhysicsVector CenterOfMass |
230 | { | 238 | { |
231 | get { return PhysicsVector.Zero; } | 239 | get { return PhysicsVector.Zero; } |
232 | } | 240 | } |
241 | |||
233 | public override PhysicsVector GeometricCenter | 242 | public override PhysicsVector GeometricCenter |
234 | { | 243 | { |
235 | get { return PhysicsVector.Zero; } | 244 | get { return PhysicsVector.Zero; } |
236 | } | 245 | } |
246 | |||
237 | public override PrimitiveBaseShape Shape | 247 | public override PrimitiveBaseShape Shape |
238 | { | 248 | { |
239 | set | 249 | set { return; } |
240 | { | ||
241 | return; | ||
242 | } | ||
243 | } | 250 | } |
244 | 251 | ||
245 | public override PhysicsVector Velocity | 252 | public override PhysicsVector Velocity |
@@ -270,6 +277,7 @@ namespace OpenSim.Region.Physics.Manager | |||
270 | get { return false; } | 277 | get { return false; } |
271 | set { return; } | 278 | set { return; } |
272 | } | 279 | } |
280 | |||
273 | public override bool ThrottleUpdates | 281 | public override bool ThrottleUpdates |
274 | { | 282 | { |
275 | get { return false; } | 283 | get { return false; } |
@@ -281,9 +289,10 @@ namespace OpenSim.Region.Physics.Manager | |||
281 | get { return false; } | 289 | get { return false; } |
282 | set { return; } | 290 | set { return; } |
283 | } | 291 | } |
292 | |||
284 | public override int PhysicsActorType | 293 | public override int PhysicsActorType |
285 | { | 294 | { |
286 | get { return (int)ActorTypes.Unknown; } | 295 | get { return (int) ActorTypes.Unknown; } |
287 | set { return; } | 296 | set { return; } |
288 | } | 297 | } |
289 | 298 | ||
@@ -297,14 +306,16 @@ namespace OpenSim.Region.Physics.Manager | |||
297 | { | 306 | { |
298 | return; | 307 | return; |
299 | } | 308 | } |
309 | |||
300 | public override PhysicsVector RotationalVelocity | 310 | public override PhysicsVector RotationalVelocity |
301 | { | 311 | { |
302 | get { return PhysicsVector.Zero; } | 312 | get { return PhysicsVector.Zero; } |
303 | set { return; } | 313 | set { return; } |
304 | } | 314 | } |
315 | |||
305 | public override void SetMomentum(PhysicsVector momentum) | 316 | public override void SetMomentum(PhysicsVector momentum) |
306 | { | 317 | { |
307 | return; | 318 | return; |
308 | } | 319 | } |
309 | } | 320 | } |
310 | } | 321 | } \ No newline at end of file |