aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs32
1 files changed, 16 insertions, 16 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 998836c..2b0a539 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -73,7 +73,7 @@ public sealed class BSPrim : BSPhysObject
73 private bool _kinematic; 73 private bool _kinematic;
74 private float _buoyancy; 74 private float _buoyancy;
75 75
76 private BSDynamics _vehicle; 76 public BSDynamics VehicleController { get; private set; }
77 77
78 private BSVMotor _targetMotor; 78 private BSVMotor _targetMotor;
79 private OMV.Vector3 _PIDTarget; 79 private OMV.Vector3 _PIDTarget;
@@ -107,7 +107,7 @@ public sealed class BSPrim : BSPhysObject
107 _friction = PhysicsScene.Params.defaultFriction; 107 _friction = PhysicsScene.Params.defaultFriction;
108 _restitution = PhysicsScene.Params.defaultRestitution; 108 _restitution = PhysicsScene.Params.defaultRestitution;
109 109
110 _vehicle = new BSDynamics(PhysicsScene, this); // add vehicleness 110 VehicleController = new BSDynamics(PhysicsScene, this); // add vehicleness
111 111
112 _mass = CalculateMass(); 112 _mass = CalculateMass();
113 113
@@ -512,7 +512,7 @@ public sealed class BSPrim : BSPhysObject
512 512
513 public override int VehicleType { 513 public override int VehicleType {
514 get { 514 get {
515 return (int)_vehicle.Type; // if we are a vehicle, return that type 515 return (int)VehicleController.Type; // if we are a vehicle, return that type
516 } 516 }
517 set { 517 set {
518 Vehicle type = (Vehicle)value; 518 Vehicle type = (Vehicle)value;
@@ -521,19 +521,19 @@ public sealed class BSPrim : BSPhysObject
521 { 521 {
522 // Done at taint time so we're sure the physics engine is not using the variables 522 // Done at taint time so we're sure the physics engine is not using the variables
523 // Vehicle code changes the parameters for this vehicle type. 523 // Vehicle code changes the parameters for this vehicle type.
524 _vehicle.ProcessTypeChange(type); 524 VehicleController.ProcessTypeChange(type);
525 ActivateIfPhysical(false); 525 ActivateIfPhysical(false);
526 526
527 // If an active vehicle, register the vehicle code to be called before each step 527 // If an active vehicle, register the vehicle code to be called before each step
528 if (_vehicle.Type == Vehicle.TYPE_NONE) 528 if (VehicleController.Type == Vehicle.TYPE_NONE)
529 { 529 {
530 UnRegisterPreStepAction("BSPrim.Vehicle", LocalID); 530 UnRegisterPreStepAction("BSPrim.Vehicle", LocalID);
531 PhysicsScene.AfterStep -= _vehicle.PostStep; 531 PhysicsScene.AfterStep -= VehicleController.PostStep;
532 } 532 }
533 else 533 else
534 { 534 {
535 RegisterPreStepAction("BSPrim.Vehicle", LocalID, _vehicle.Step); 535 RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step);
536 PhysicsScene.AfterStep += _vehicle.PostStep; 536 PhysicsScene.AfterStep += VehicleController.PostStep;
537 } 537 }
538 }); 538 });
539 } 539 }
@@ -542,7 +542,7 @@ public sealed class BSPrim : BSPhysObject
542 { 542 {
543 PhysicsScene.TaintedObject("BSPrim.VehicleFloatParam", delegate() 543 PhysicsScene.TaintedObject("BSPrim.VehicleFloatParam", delegate()
544 { 544 {
545 _vehicle.ProcessFloatVehicleParam((Vehicle)param, value); 545 VehicleController.ProcessFloatVehicleParam((Vehicle)param, value);
546 ActivateIfPhysical(false); 546 ActivateIfPhysical(false);
547 }); 547 });
548 } 548 }
@@ -550,7 +550,7 @@ public sealed class BSPrim : BSPhysObject
550 { 550 {
551 PhysicsScene.TaintedObject("BSPrim.VehicleVectorParam", delegate() 551 PhysicsScene.TaintedObject("BSPrim.VehicleVectorParam", delegate()
552 { 552 {
553 _vehicle.ProcessVectorVehicleParam((Vehicle)param, value); 553 VehicleController.ProcessVectorVehicleParam((Vehicle)param, value);
554 ActivateIfPhysical(false); 554 ActivateIfPhysical(false);
555 }); 555 });
556 } 556 }
@@ -558,7 +558,7 @@ public sealed class BSPrim : BSPhysObject
558 { 558 {
559 PhysicsScene.TaintedObject("BSPrim.VehicleRotationParam", delegate() 559 PhysicsScene.TaintedObject("BSPrim.VehicleRotationParam", delegate()
560 { 560 {
561 _vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation); 561 VehicleController.ProcessRotationVehicleParam((Vehicle)param, rotation);
562 ActivateIfPhysical(false); 562 ActivateIfPhysical(false);
563 }); 563 });
564 } 564 }
@@ -566,7 +566,7 @@ public sealed class BSPrim : BSPhysObject
566 { 566 {
567 PhysicsScene.TaintedObject("BSPrim.VehicleFlags", delegate() 567 PhysicsScene.TaintedObject("BSPrim.VehicleFlags", delegate()
568 { 568 {
569 _vehicle.ProcessVehicleFlags(param, remove); 569 VehicleController.ProcessVehicleFlags(param, remove);
570 }); 570 });
571 } 571 }
572 572
@@ -747,7 +747,7 @@ public sealed class BSPrim : BSPhysObject
747 // isSolid: other objects bounce off of this object 747 // isSolid: other objects bounce off of this object
748 // isVolumeDetect: other objects pass through but can generate collisions 748 // isVolumeDetect: other objects pass through but can generate collisions
749 // collisionEvents: whether this object returns collision events 749 // collisionEvents: whether this object returns collision events
750 private void UpdatePhysicalParameters() 750 public void UpdatePhysicalParameters()
751 { 751 {
752 // DetailLog("{0},BSPrim.UpdatePhysicalParameters,entry,body={1},shape={2}", LocalID, BSBody, BSShape); 752 // DetailLog("{0},BSPrim.UpdatePhysicalParameters,entry,body={1},shape={2}", LocalID, BSBody, BSShape);
753 753
@@ -759,7 +759,7 @@ public sealed class BSPrim : BSPhysObject
759 MakeDynamic(IsStatic); 759 MakeDynamic(IsStatic);
760 760
761 // Update vehicle specific parameters (after MakeDynamic() so can change physical parameters) 761 // Update vehicle specific parameters (after MakeDynamic() so can change physical parameters)
762 _vehicle.Refresh(); 762 VehicleController.Refresh();
763 763
764 // Arrange for collision events if the simulator wants them 764 // Arrange for collision events if the simulator wants them
765 EnableCollisions(SubscribedEvents()); 765 EnableCollisions(SubscribedEvents());
@@ -1601,7 +1601,7 @@ public sealed class BSPrim : BSPhysObject
1601 // Remove all the physical dependencies on the old body. 1601 // Remove all the physical dependencies on the old body.
1602 // (Maybe someday make the changing of BSShape an event to be subscribed to by BSLinkset, ...) 1602 // (Maybe someday make the changing of BSShape an event to be subscribed to by BSLinkset, ...)
1603 Linkset.RemoveBodyDependencies(this); 1603 Linkset.RemoveBodyDependencies(this);
1604 _vehicle.RemoveBodyDependencies(this); 1604 VehicleController.RemoveBodyDependencies(this);
1605 }); 1605 });
1606 1606
1607 // Make sure the properties are set on the new object 1607 // Make sure the properties are set on the new object
@@ -1618,7 +1618,7 @@ public sealed class BSPrim : BSPhysObject
1618 { 1618 {
1619 // A temporary kludge to suppress the rotational effects introduced on vehicles by Bullet 1619 // A temporary kludge to suppress the rotational effects introduced on vehicles by Bullet
1620 // TODO: handle physics introduced by Bullet with computed vehicle physics. 1620 // TODO: handle physics introduced by Bullet with computed vehicle physics.
1621 if (_vehicle.IsActive) 1621 if (VehicleController.IsActive)
1622 { 1622 {
1623 entprop.RotationalVelocity = OMV.Vector3.Zero; 1623 entprop.RotationalVelocity = OMV.Vector3.Zero;
1624 } 1624 }