diff options
author | Robert Adams | 2013-01-25 10:17:20 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-27 12:50:04 -0800 |
commit | c44a8e9f925c0195c4754c5e763af06dae657b53 (patch) | |
tree | 36bf371e99fb977be94c40a8d6998aaa5180a03c /OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |
parent | Prevent items being destroyed by rename operations. Renaming of a wearable also (diff) | |
download | opensim-SC_OLD-c44a8e9f925c0195c4754c5e763af06dae657b53.zip opensim-SC_OLD-c44a8e9f925c0195c4754c5e763af06dae657b53.tar.gz opensim-SC_OLD-c44a8e9f925c0195c4754c5e763af06dae657b53.tar.bz2 opensim-SC_OLD-c44a8e9f925c0195c4754c5e763af06dae657b53.tar.xz |
BulletSim: finish the post step event for physical object actions. Modify vehicle to use post step event for logging.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 7ad7c89..a369c1f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -583,6 +583,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
583 | 583 | ||
584 | // Some of the properties of this prim may have changed. | 584 | // Some of the properties of this prim may have changed. |
585 | // Do any updating needed for a vehicle | 585 | // Do any updating needed for a vehicle |
586 | Vector3 m_physicsLinearFactor = new Vector3(0.2f, 0.2f, 0.2f); // DEBUG DEBUG | ||
587 | Vector3 m_physicsAngularFactor = new Vector3(0.2f, 0.2f, 0.2f); // DEBUG DEBUG | ||
586 | public void Refresh() | 588 | public void Refresh() |
587 | { | 589 | { |
588 | if (IsActive) | 590 | if (IsActive) |
@@ -599,6 +601,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
599 | // Maybe compute linear and angular factor and damping from params. | 601 | // Maybe compute linear and angular factor and damping from params. |
600 | float angularDamping = BSParam.VehicleAngularDamping; | 602 | float angularDamping = BSParam.VehicleAngularDamping; |
601 | PhysicsScene.PE.SetAngularDamping(Prim.PhysBody, angularDamping); | 603 | PhysicsScene.PE.SetAngularDamping(Prim.PhysBody, angularDamping); |
604 | PhysicsScene.PE.SetLinearFactor(Prim.PhysBody, m_physicsLinearFactor); // DEBUG DEBUG | ||
605 | PhysicsScene.PE.SetAngularFactorV(Prim.PhysBody, m_physicsAngularFactor); // DEBUG DEBUG | ||
602 | 606 | ||
603 | // Vehicles report collision events so we know when it's on the ground | 607 | // Vehicles report collision events so we know when it's on the ground |
604 | PhysicsScene.PE.AddToCollisionFlags(Prim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS); | 608 | PhysicsScene.PE.AddToCollisionFlags(Prim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS); |
@@ -898,9 +902,6 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
898 | { | 902 | { |
899 | if (!IsActive) return; | 903 | if (!IsActive) return; |
900 | 904 | ||
901 | if (PhysicsScene.VehiclePhysicalLoggingEnabled) | ||
902 | PhysicsScene.PE.DumpRigidBody(PhysicsScene.World, Prim.PhysBody); | ||
903 | |||
904 | ForgetKnownVehicleProperties(); | 905 | ForgetKnownVehicleProperties(); |
905 | 906 | ||
906 | MoveLinear(pTimestep); | 907 | MoveLinear(pTimestep); |
@@ -922,6 +923,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
922 | Prim.LocalID, VehiclePosition, m_knownForce, VehicleVelocity, VehicleRotationalVelocity); | 923 | Prim.LocalID, VehiclePosition, m_knownForce, VehicleVelocity, VehicleRotationalVelocity); |
923 | } | 924 | } |
924 | 925 | ||
926 | // Called after the simulation step | ||
927 | internal void PostStep(float pTimestep) | ||
928 | { | ||
929 | if (PhysicsScene.VehiclePhysicalLoggingEnabled) | ||
930 | PhysicsScene.PE.DumpRigidBody(PhysicsScene.World, Prim.PhysBody); | ||
931 | } | ||
932 | |||
925 | // Apply the effect of the linear motor and other linear motions (like hover and float). | 933 | // Apply the effect of the linear motor and other linear motions (like hover and float). |
926 | private void MoveLinear(float pTimestep) | 934 | private void MoveLinear(float pTimestep) |
927 | { | 935 | { |