aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs128
1 files changed, 64 insertions, 64 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
index 5db4f17..62fd279 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -477,58 +477,58 @@ namespace OpenSim.Region.Physics.OdePlugin
477 477
478 // if(childPrim) we only know about physical linksets 478 // if(childPrim) we only know about physical linksets
479 return Ptot; 479 return Ptot;
480 /* 480/*
481 float tmass = _mass; 481 float tmass = _mass;
482 Ptot *= tmass; 482 Ptot *= tmass;
483 483
484 float m; 484 float m;
485 485
486 foreach (OdePrim prm in childrenPrim) 486 foreach (OdePrim prm in childrenPrim)
487 { 487 {
488 m = prm._mass; 488 m = prm._mass;
489 Ptot += prm.CenterOfMass * m; 489 Ptot += prm.CenterOfMass * m;
490 tmass += m; 490 tmass += m;
491 } 491 }
492 492
493 if (tmass == 0) 493 if (tmass == 0)
494 tmass = 0; 494 tmass = 0;
495 else 495 else
496 tmass = 1.0f / tmass; 496 tmass = 1.0f / tmass;
497 497
498 Ptot *= tmass; 498 Ptot *= tmass;
499 return Ptot; 499 return Ptot;
500 */ 500*/
501 } 501 }
502 else 502 else
503 return _position; 503 return _position;
504 } 504 }
505 } 505 }
506 } 506 }
507 /* 507/*
508 public override Vector3 PrimOOBsize 508 public override Vector3 PrimOOBsize
509 { 509 {
510 get 510 get
511 { 511 {
512 return primOOBsize; 512 return primOOBsize;
513 } 513 }
514 } 514 }
515 515
516 public override Vector3 PrimOOBoffset 516 public override Vector3 PrimOOBoffset
517 { 517 {
518 get 518 get
519 { 519 {
520 return primOOBoffset; 520 return primOOBoffset;
521 } 521 }
522 } 522 }
523 523
524 public override float PrimOOBRadiusSQ 524 public override float PrimOOBRadiusSQ
525 { 525 {
526 get 526 get
527 { 527 {
528 return primOOBradiusSQ; 528 return primOOBradiusSQ;
529 } 529 }
530 } 530 }
531 */ 531*/
532 public override PrimitiveBaseShape Shape 532 public override PrimitiveBaseShape Shape
533 { 533 {
534 set 534 set
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Physics.OdePlugin
582 if (value.IsFinite()) 582 if (value.IsFinite())
583 { 583 {
584 AddChange(changes.Velocity, value); 584 AddChange(changes.Velocity, value);
585 // _velocity = value; 585// _velocity = value;
586 586
587 } 587 }
588 else 588 else
@@ -937,12 +937,10 @@ namespace OpenSim.Region.Physics.OdePlugin
937 if (CollisionEventsThisFrame == null) 937 if (CollisionEventsThisFrame == null)
938 CollisionEventsThisFrame = new CollisionEventUpdate(); 938 CollisionEventsThisFrame = new CollisionEventUpdate();
939 SentEmptyCollisionsEvent = false; 939 SentEmptyCollisionsEvent = false;
940 _parent_scene.AddCollisionEventReporting(this);
941 } 940 }
942 941
943 public override void UnSubscribeEvents() 942 public override void UnSubscribeEvents()
944 { 943 {
945 _parent_scene.RemoveCollisionEventReporting(this);
946 if (CollisionEventsThisFrame != null) 944 if (CollisionEventsThisFrame != null)
947 { 945 {
948 CollisionEventsThisFrame.Clear(); 946 CollisionEventsThisFrame.Clear();
@@ -975,7 +973,10 @@ namespace OpenSim.Region.Physics.OdePlugin
975 base.SendCollisionUpdate(CollisionEventsThisFrame); 973 base.SendCollisionUpdate(CollisionEventsThisFrame);
976 974
977 if (ncolisions == 0) 975 if (ncolisions == 0)
976 {
978 SentEmptyCollisionsEvent = true; 977 SentEmptyCollisionsEvent = true;
978 _parent_scene.RemoveCollisionEventReporting(this);
979 }
979 else 980 else
980 { 981 {
981 SentEmptyCollisionsEvent = false; 982 SentEmptyCollisionsEvent = false;
@@ -986,11 +987,10 @@ namespace OpenSim.Region.Physics.OdePlugin
986 987
987 internal void AddCollisionFrameTime(int t) 988 internal void AddCollisionFrameTime(int t)
988 { 989 {
989 // protect it from overflow crashing 990 if (m_cureventsubscription < 50000)
990 if (m_cureventsubscription + t >= int.MaxValue) 991 m_cureventsubscription += t;
991 m_cureventsubscription = 0;
992 m_cureventsubscription += t;
993 } 992 }
993
994 public override bool SubscribedEvents() 994 public override bool SubscribedEvents()
995 { 995 {
996 if (m_eventsubscription > 0) 996 if (m_eventsubscription > 0)
@@ -1735,8 +1735,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1735 1735
1736 d.BodySetAutoDisableFlag(Body, true); 1736 d.BodySetAutoDisableFlag(Body, true);
1737 d.BodySetAutoDisableSteps(Body, body_autodisable_frames); 1737 d.BodySetAutoDisableSteps(Body, body_autodisable_frames);
1738 // d.BodySetLinearDampingThreshold(Body, 0.01f); 1738// d.BodySetLinearDampingThreshold(Body, 0.01f);
1739 // d.BodySetAngularDampingThreshold(Body, 0.001f); 1739// d.BodySetAngularDampingThreshold(Body, 0.001f);
1740 d.BodySetDamping(Body, .002f, .002f); 1740 d.BodySetDamping(Body, .002f, .002f);
1741 1741
1742 if (m_targetSpace != IntPtr.Zero) 1742 if (m_targetSpace != IntPtr.Zero)
@@ -2966,7 +2966,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2966 givefakepos--; 2966 givefakepos--;
2967 if (givefakepos < 0) 2967 if (givefakepos < 0)
2968 givefakepos = 0; 2968 givefakepos = 0;
2969 // changeSelectedStatus(); 2969// changeSelectedStatus();
2970 resetCollisionAccounting(); 2970 resetCollisionAccounting();
2971 } 2971 }
2972 2972
@@ -2981,14 +2981,14 @@ namespace OpenSim.Region.Physics.OdePlugin
2981 { 2981 {
2982 _orientation = newOri; 2982 _orientation = newOri;
2983 } 2983 }
2984 /* 2984/*
2985 else if (m_forcePosOrRotation && _orientation != newOri && Body != IntPtr.Zero) 2985 else if (m_forcePosOrRotation && _orientation != newOri && Body != IntPtr.Zero)
2986 { 2986 {
2987 FixInertia(_position, newOri); 2987 FixInertia(_position, newOri);
2988 if (!d.BodyIsEnabled(Body)) 2988 if (!d.BodyIsEnabled(Body))
2989 d.BodyEnable(Body); 2989 d.BodyEnable(Body);
2990 } 2990 }
2991 */ 2991*/
2992 } 2992 }
2993 else 2993 else
2994 { 2994 {
@@ -3939,12 +3939,12 @@ namespace OpenSim.Region.Physics.OdePlugin
3939 changevelocity((Vector3)arg); 3939 changevelocity((Vector3)arg);
3940 break; 3940 break;
3941 3941
3942 // case changes.Acceleration: 3942// case changes.Acceleration:
3943 // changeacceleration((Vector3)arg); 3943// changeacceleration((Vector3)arg);
3944 // break; 3944// break;
3945 // case changes.AngVelocity: 3945// case changes.AngVelocity:
3946 // changeangvelocity((Vector3)arg); 3946// changeangvelocity((Vector3)arg);
3947 // break; 3947// break;
3948 3948
3949 case changes.Force: 3949 case changes.Force:
3950 changeForce((Vector3)arg); 3950 changeForce((Vector3)arg);