aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs26
1 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 0bdfbe3..13c2539 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -558,30 +558,30 @@ namespace OpenSim.Region.Physics.BulletSPlugin
558 558
559 // Friction affects are handled by this vehicle code 559 // Friction affects are handled by this vehicle code
560 float friction = 0f; 560 float friction = 0f;
561 BulletSimAPI.SetFriction2(Prim.PhysBody.ptr, friction); 561 PhysicsScene.PE.SetFriction(Prim.PhysBody, friction);
562 562
563 // Moderate angular movement introduced by Bullet. 563 // Moderate angular movement introduced by Bullet.
564 // TODO: possibly set AngularFactor and LinearFactor for the type of vehicle. 564 // TODO: possibly set AngularFactor and LinearFactor for the type of vehicle.
565 // Maybe compute linear and angular factor and damping from params. 565 // Maybe compute linear and angular factor and damping from params.
566 float angularDamping = BSParam.VehicleAngularDamping; 566 float angularDamping = BSParam.VehicleAngularDamping;
567 BulletSimAPI.SetAngularDamping2(Prim.PhysBody.ptr, angularDamping); 567 PhysicsScene.PE.SetAngularDamping(Prim.PhysBody, angularDamping);
568 568
569 // Vehicles report collision events so we know when it's on the ground 569 // Vehicles report collision events so we know when it's on the ground
570 BulletSimAPI.AddToCollisionFlags2(Prim.PhysBody.ptr, CollisionFlags.BS_VEHICLE_COLLISIONS); 570 PhysicsScene.PE.AddToCollisionFlags(Prim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS);
571 571
572 Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(Prim.PhysShape.ptr, m_vehicleMass); 572 Vector3 localInertia = PhysicsScene.PE.CalculateLocalInertia(Prim.PhysShape, m_vehicleMass);
573 BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, localInertia); 573 PhysicsScene.PE.SetMassProps(Prim.PhysBody, m_vehicleMass, localInertia);
574 BulletSimAPI.UpdateInertiaTensor2(Prim.PhysBody.ptr); 574 PhysicsScene.PE.UpdateInertiaTensor(Prim.PhysBody);
575 575
576 Vector3 grav = PhysicsScene.DefaultGravity * (1f - Prim.Buoyancy); 576 Vector3 grav = PhysicsScene.DefaultGravity * (1f - Prim.Buoyancy);
577 BulletSimAPI.SetGravity2(Prim.PhysBody.ptr, grav); 577 PhysicsScene.PE.SetGravity(Prim.PhysBody, grav);
578 578
579 VDetailLog("{0},BSDynamics.Refresh,mass={1},frict={2},inert={3},aDamp={4}", 579 VDetailLog("{0},BSDynamics.Refresh,mass={1},frict={2},inert={3},aDamp={4}",
580 Prim.LocalID, m_vehicleMass, friction, localInertia, angularDamping); 580 Prim.LocalID, m_vehicleMass, friction, localInertia, angularDamping);
581 } 581 }
582 else 582 else
583 { 583 {
584 BulletSimAPI.RemoveFromCollisionFlags2(Prim.PhysBody.ptr, CollisionFlags.BS_VEHICLE_COLLISIONS); 584 PhysicsScene.PE.RemoveFromCollisionFlags(Prim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS);
585 } 585 }
586 } 586 }
587 587
@@ -651,7 +651,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
651 if ((m_knownChanged & m_knownChangedVelocity) != 0) 651 if ((m_knownChanged & m_knownChangedVelocity) != 0)
652 { 652 {
653 Prim.ForceVelocity = m_knownVelocity; 653 Prim.ForceVelocity = m_knownVelocity;
654 BulletSimAPI.SetInterpolationLinearVelocity2(Prim.PhysBody.ptr, VehicleVelocity); 654 PhysicsScene.PE.SetInterpolationLinearVelocity(Prim.PhysBody, VehicleVelocity);
655 } 655 }
656 656
657 if ((m_knownChanged & m_knownChangedForce) != 0) 657 if ((m_knownChanged & m_knownChangedForce) != 0)
@@ -661,7 +661,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
661 { 661 {
662 Prim.ForceRotationalVelocity = m_knownRotationalVelocity; 662 Prim.ForceRotationalVelocity = m_knownRotationalVelocity;
663 // Fake out Bullet by making it think the velocity is the same as last time. 663 // Fake out Bullet by making it think the velocity is the same as last time.
664 BulletSimAPI.SetInterpolationAngularVelocity2(Prim.PhysBody.ptr, m_knownRotationalVelocity); 664 PhysicsScene.PE.SetInterpolationAngularVelocity(Prim.PhysBody, m_knownRotationalVelocity);
665 } 665 }
666 666
667 if ((m_knownChanged & m_knownChangedRotationalForce) != 0) 667 if ((m_knownChanged & m_knownChangedRotationalForce) != 0)
@@ -669,7 +669,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
669 669
670 // If we set one of the values (ie, the physics engine didn't do it) we must force 670 // If we set one of the values (ie, the physics engine didn't do it) we must force
671 // an UpdateProperties event to send the changes up to the simulator. 671 // an UpdateProperties event to send the changes up to the simulator.
672 BulletSimAPI.PushUpdate2(Prim.PhysBody.ptr); 672 PhysicsScene.PE.PushUpdate(Prim.PhysBody);
673 } 673 }
674 m_knownChanged = 0; 674 m_knownChanged = 0;
675 } 675 }
@@ -823,7 +823,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
823 if (!IsActive) return; 823 if (!IsActive) return;
824 824
825 if (PhysicsScene.VehiclePhysicalLoggingEnabled) 825 if (PhysicsScene.VehiclePhysicalLoggingEnabled)
826 BulletSimAPI.DumpRigidBody2(PhysicsScene.World.ptr, Prim.PhysBody.ptr); 826 PhysicsScene.PE.DumpRigidBody(PhysicsScene.World, Prim.PhysBody);
827 827
828 ForgetKnownVehicleProperties(); 828 ForgetKnownVehicleProperties();
829 829
@@ -840,7 +840,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
840 PushKnownChanged(); 840 PushKnownChanged();
841 841
842 if (PhysicsScene.VehiclePhysicalLoggingEnabled) 842 if (PhysicsScene.VehiclePhysicalLoggingEnabled)
843 BulletSimAPI.DumpRigidBody2(PhysicsScene.World.ptr, Prim.PhysBody.ptr); 843 PhysicsScene.PE.DumpRigidBody(PhysicsScene.World, Prim.PhysBody);
844 844
845 VDetailLog("{0},BSDynamics.Step,done,pos={1},force={2},velocity={3},angvel={4}", 845 VDetailLog("{0},BSDynamics.Step,done,pos={1},force={2},velocity={3},angvel={4}",
846 Prim.LocalID, VehiclePosition, Prim.Force, VehicleVelocity, VehicleRotationalVelocity); 846 Prim.LocalID, VehiclePosition, Prim.Force, VehicleVelocity, VehicleRotationalVelocity);