diff options
author | UbitUmarov | 2012-07-15 00:50:00 +0100 |
---|---|---|
committer | UbitUmarov | 2012-07-15 00:50:00 +0100 |
commit | 62df82b74d0f3599585f7320aeab8c6a8262f61f (patch) | |
tree | ce65558db728ca6ffb4c3f78772bd14e3943328d /OpenSim/Region/Physics/Manager | |
parent | remove forgotten line... (diff) | |
download | opensim-SC_OLD-62df82b74d0f3599585f7320aeab8c6a8262f61f.zip opensim-SC_OLD-62df82b74d0f3599585f7320aeab8c6a8262f61f.tar.gz opensim-SC_OLD-62df82b74d0f3599585f7320aeab8c6a8262f61f.tar.bz2 opensim-SC_OLD-62df82b74d0f3599585f7320aeab8c6a8262f61f.tar.xz |
messing around... Let terrain and water have nullphysicsactors, let
nullphyscisactors have a type water, ground or unknown (default). having
this removed geom to name mapping no longer needed. Made some more methods
comum to prims and characters acessible via PhysActor allowing for a more
uniform access. ...
Diffstat (limited to 'OpenSim/Region/Physics/Manager')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 143 |
1 files changed, 48 insertions, 95 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index aaeae86..a2c72c3 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -43,7 +43,8 @@ namespace OpenSim.Region.Physics.Manager | |||
43 | Unknown = 0, | 43 | Unknown = 0, |
44 | Agent = 1, | 44 | Agent = 1, |
45 | Prim = 2, | 45 | Prim = 2, |
46 | Ground = 3 | 46 | Ground = 3, |
47 | Water = 4 | ||
47 | } | 48 | } |
48 | 49 | ||
49 | public enum PIDHoverType | 50 | public enum PIDHoverType |
@@ -114,7 +115,7 @@ namespace OpenSim.Region.Physics.Manager | |||
114 | m_objCollisionList.Add(localID, contact); | 115 | m_objCollisionList.Add(localID, contact); |
115 | } | 116 | } |
116 | else | 117 | else |
117 | { | 118 | { |
118 | if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth) | 119 | if (m_objCollisionList[localID].PenetrationDepth < contact.PenetrationDepth) |
119 | m_objCollisionList[localID] = contact; | 120 | m_objCollisionList[localID] = contact; |
120 | } | 121 | } |
@@ -202,7 +203,7 @@ namespace OpenSim.Region.Physics.Manager | |||
202 | /// XXX: Bizarrely, this cannot be "Terrain" or "Water" right now unless it really is simulating terrain or | 203 | /// XXX: Bizarrely, this cannot be "Terrain" or "Water" right now unless it really is simulating terrain or |
203 | /// water. This is not a problem due to the formatting of names given by prims and avatars. | 204 | /// water. This is not a problem due to the formatting of names given by prims and avatars. |
204 | /// </remarks> | 205 | /// </remarks> |
205 | public string Name { get; protected set; } | 206 | public string Name { get; set; } |
206 | 207 | ||
207 | /// <summary> | 208 | /// <summary> |
208 | /// This is being used by ODE joint code. | 209 | /// This is being used by ODE joint code. |
@@ -230,11 +231,6 @@ namespace OpenSim.Region.Physics.Manager | |||
230 | } | 231 | } |
231 | } | 232 | } |
232 | 233 | ||
233 | public virtual byte[] Serialize(bool PhysIsRunning) | ||
234 | { | ||
235 | return new byte[0]; | ||
236 | } | ||
237 | |||
238 | public virtual void RaiseOutOfBounds(Vector3 pos) | 234 | public virtual void RaiseOutOfBounds(Vector3 pos) |
239 | { | 235 | { |
240 | // Make a temporary copy of the event to avoid possibility of | 236 | // Make a temporary copy of the event to avoid possibility of |
@@ -258,10 +254,7 @@ namespace OpenSim.Region.Physics.Manager | |||
258 | handler(e); | 254 | handler(e); |
259 | } | 255 | } |
260 | 256 | ||
261 | public virtual void SetMaterial (int material) | 257 | public virtual void SetMaterial (int material) { } |
262 | { | ||
263 | } | ||
264 | |||
265 | public virtual float Density { get; set; } | 258 | public virtual float Density { get; set; } |
266 | public virtual float GravModifier { get; set; } | 259 | public virtual float GravModifier { get; set; } |
267 | public virtual float Friction { get; set; } | 260 | public virtual float Friction { get; set; } |
@@ -373,13 +366,21 @@ namespace OpenSim.Region.Physics.Manager | |||
373 | public abstract void SubscribeEvents(int ms); | 366 | public abstract void SubscribeEvents(int ms); |
374 | public abstract void UnSubscribeEvents(); | 367 | public abstract void UnSubscribeEvents(); |
375 | public abstract bool SubscribedEvents(); | 368 | public abstract bool SubscribedEvents(); |
369 | |||
370 | public virtual void AddCollisionEvent(uint CollidedWith, ContactPoint contact) { } | ||
371 | |||
372 | // Warning in a parent part it returns itself, not null | ||
373 | public virtual PhysicsActor ParentActor { get { return this; } } | ||
374 | |||
376 | } | 375 | } |
377 | 376 | ||
378 | public class NullPhysicsActor : PhysicsActor | 377 | public class NullPhysicsActor : PhysicsActor |
379 | { | 378 | { |
379 | private ActorTypes m_actorType = ActorTypes.Unknown; | ||
380 | |||
380 | public override bool Stopped | 381 | public override bool Stopped |
381 | { | 382 | { |
382 | get{ return false; } | 383 | get{ return true; } |
383 | } | 384 | } |
384 | 385 | ||
385 | public override Vector3 Position | 386 | public override Vector3 Position |
@@ -396,6 +397,7 @@ namespace OpenSim.Region.Physics.Manager | |||
396 | 397 | ||
397 | public override uint LocalID | 398 | public override uint LocalID |
398 | { | 399 | { |
400 | get { return 0; } | ||
399 | set { return; } | 401 | set { return; } |
400 | } | 402 | } |
401 | 403 | ||
@@ -455,49 +457,17 @@ namespace OpenSim.Region.Physics.Manager | |||
455 | set { return; } | 457 | set { return; } |
456 | } | 458 | } |
457 | 459 | ||
458 | public override void VehicleFloatParam(int param, float value) | 460 | public override void VehicleFloatParam(int param, float value) {} |
459 | { | 461 | public override void VehicleVectorParam(int param, Vector3 value) { } |
460 | } | 462 | public override void VehicleRotationParam(int param, Quaternion rotation) { } |
461 | 463 | public override void VehicleFlags(int param, bool remove) { } | |
462 | public override void VehicleVectorParam(int param, Vector3 value) | 464 | public override void SetVolumeDetect(int param) {} |
463 | { | 465 | public override void SetMaterial(int material) {} |
464 | 466 | public override Vector3 CenterOfMass { get { return Vector3.Zero; }} | |
465 | } | ||
466 | |||
467 | public override void VehicleRotationParam(int param, Quaternion rotation) | ||
468 | { | ||
469 | |||
470 | } | ||
471 | |||
472 | public override void VehicleFlags(int param, bool remove) | ||
473 | { | ||
474 | |||
475 | } | ||
476 | |||
477 | public override void SetVolumeDetect(int param) | ||
478 | { | ||
479 | |||
480 | } | ||
481 | |||
482 | public override void SetMaterial(int material) | ||
483 | { | ||
484 | |||
485 | } | ||
486 | |||
487 | public override Vector3 CenterOfMass | ||
488 | { | ||
489 | get { return Vector3.Zero; } | ||
490 | } | ||
491 | 467 | ||
492 | public override Vector3 GeometricCenter | 468 | public override Vector3 GeometricCenter { get { return Vector3.Zero; }} |
493 | { | ||
494 | get { return Vector3.Zero; } | ||
495 | } | ||
496 | 469 | ||
497 | public override PrimitiveBaseShape Shape | 470 | public override PrimitiveBaseShape Shape { set { return; }} |
498 | { | ||
499 | set { return; } | ||
500 | } | ||
501 | 471 | ||
502 | public override Vector3 Velocity | 472 | public override Vector3 Velocity |
503 | { | 473 | { |
@@ -517,9 +487,7 @@ namespace OpenSim.Region.Physics.Manager | |||
517 | set { } | 487 | set { } |
518 | } | 488 | } |
519 | 489 | ||
520 | public override void CrossingFailure() | 490 | public override void CrossingFailure() {} |
521 | { | ||
522 | } | ||
523 | 491 | ||
524 | public override Quaternion Orientation | 492 | public override Quaternion Orientation |
525 | { | 493 | { |
@@ -559,8 +527,20 @@ namespace OpenSim.Region.Physics.Manager | |||
559 | 527 | ||
560 | public override int PhysicsActorType | 528 | public override int PhysicsActorType |
561 | { | 529 | { |
562 | get { return (int) ActorTypes.Unknown; } | 530 | get { return (int)m_actorType; } |
563 | set { return; } | 531 | set { |
532 | ActorTypes type = (ActorTypes)value; | ||
533 | switch (type) | ||
534 | { | ||
535 | case ActorTypes.Ground: | ||
536 | case ActorTypes.Water: | ||
537 | m_actorType = type; | ||
538 | break; | ||
539 | default: | ||
540 | m_actorType = ActorTypes.Unknown; | ||
541 | break; | ||
542 | } | ||
543 | } | ||
564 | } | 544 | } |
565 | 545 | ||
566 | public override bool Kinematic | 546 | public override bool Kinematic |
@@ -569,26 +549,11 @@ namespace OpenSim.Region.Physics.Manager | |||
569 | set { return; } | 549 | set { return; } |
570 | } | 550 | } |
571 | 551 | ||
572 | public override void link(PhysicsActor obj) | 552 | public override void link(PhysicsActor obj) { } |
573 | { | 553 | public override void delink() { } |
574 | } | 554 | public override void LockAngularMotion(Vector3 axis) { } |
575 | 555 | public override void AddForce(Vector3 force, bool pushforce) { } | |
576 | public override void delink() | 556 | public override void AddAngularForce(Vector3 force, bool pushforce) { } |
577 | { | ||
578 | } | ||
579 | |||
580 | public override void LockAngularMotion(Vector3 axis) | ||
581 | { | ||
582 | } | ||
583 | |||
584 | public override void AddForce(Vector3 force, bool pushforce) | ||
585 | { | ||
586 | } | ||
587 | |||
588 | public override void AddAngularForce(Vector3 force, bool pushforce) | ||
589 | { | ||
590 | |||
591 | } | ||
592 | 557 | ||
593 | public override Vector3 RotationalVelocity | 558 | public override Vector3 RotationalVelocity |
594 | { | 559 | { |
@@ -610,22 +575,10 @@ namespace OpenSim.Region.Physics.Manager | |||
610 | public override float APIDStrength { set { return; } } | 575 | public override float APIDStrength { set { return; } } |
611 | public override float APIDDamping { set { return; } } | 576 | public override float APIDDamping { set { return; } } |
612 | 577 | ||
613 | public override void SetMomentum(Vector3 momentum) | 578 | public override void SetMomentum(Vector3 momentum) { } |
614 | { | ||
615 | } | ||
616 | |||
617 | public override void SubscribeEvents(int ms) | ||
618 | { | ||
619 | |||
620 | } | ||
621 | public override void UnSubscribeEvents() | ||
622 | { | ||
623 | |||
624 | } | ||
625 | public override bool SubscribedEvents() | ||
626 | { | ||
627 | return false; | ||
628 | } | ||
629 | 579 | ||
580 | public override void SubscribeEvents(int ms) { } | ||
581 | public override void UnSubscribeEvents() { } | ||
582 | public override bool SubscribedEvents() { return false; } | ||
630 | } | 583 | } |
631 | } | 584 | } |