diff options
author | Robert Adams | 2012-11-26 10:47:34 -0800 |
---|---|---|
committer | Robert Adams | 2012-11-26 10:47:34 -0800 |
commit | 5685b33071c683c41643fcb78d6f8a28d98db468 (patch) | |
tree | 3e180ef8124130c127823fefabed217031df6dd9 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |
parent | BulletSim: use m_angularMotor to do the basic movement. Add the setting of sa... (diff) | |
download | opensim-SC_OLD-5685b33071c683c41643fcb78d6f8a28d98db468.zip opensim-SC_OLD-5685b33071c683c41643fcb78d6f8a28d98db468.tar.gz opensim-SC_OLD-5685b33071c683c41643fcb78d6f8a28d98db468.tar.bz2 opensim-SC_OLD-5685b33071c683c41643fcb78d6f8a28d98db468.tar.xz |
BulletSim: increase vehicle stability by suppressing Bullet's update to angular velocity.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 50 |
1 files changed, 6 insertions, 44 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index caa6c46..c62c79a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1380,54 +1380,16 @@ public sealed class BSPrim : BSPhysObject | |||
1380 | 1380 | ||
1381 | public override void UpdateProperties(EntityProperties entprop) | 1381 | public override void UpdateProperties(EntityProperties entprop) |
1382 | { | 1382 | { |
1383 | /* | 1383 | // Updates only for individual prims and for the root object of a linkset. |
1384 | UpdatedProperties changed = 0; | 1384 | if (Linkset.IsRoot(this)) |
1385 | // assign to the local variables so the normal set action does not happen | ||
1386 | // if (_position != entprop.Position) | ||
1387 | if (!_position.ApproxEquals(entprop.Position, POSITION_TOLERANCE)) | ||
1388 | { | ||
1389 | _position = entprop.Position; | ||
1390 | changed |= UpdatedProperties.Position; | ||
1391 | } | ||
1392 | // if (_orientation != entprop.Rotation) | ||
1393 | if (!_orientation.ApproxEquals(entprop.Rotation, ROTATION_TOLERANCE)) | ||
1394 | { | ||
1395 | _orientation = entprop.Rotation; | ||
1396 | changed |= UpdatedProperties.Rotation; | ||
1397 | } | ||
1398 | // if (_velocity != entprop.Velocity) | ||
1399 | if (!_velocity.ApproxEquals(entprop.Velocity, VELOCITY_TOLERANCE)) | ||
1400 | { | ||
1401 | _velocity = entprop.Velocity; | ||
1402 | changed |= UpdatedProperties.Velocity; | ||
1403 | } | ||
1404 | // if (_acceleration != entprop.Acceleration) | ||
1405 | if (!_acceleration.ApproxEquals(entprop.Acceleration, ACCELERATION_TOLERANCE)) | ||
1406 | { | ||
1407 | _acceleration = entprop.Acceleration; | ||
1408 | changed |= UpdatedProperties.Acceleration; | ||
1409 | } | ||
1410 | // if (_rotationalVelocity != entprop.RotationalVelocity) | ||
1411 | if (!_rotationalVelocity.ApproxEquals(entprop.RotationalVelocity, ROTATIONAL_VELOCITY_TOLERANCE)) | ||
1412 | { | ||
1413 | _rotationalVelocity = entprop.RotationalVelocity; | ||
1414 | changed |= UpdatedProperties.RotationalVel; | ||
1415 | } | ||
1416 | if (changed != 0) | ||
1417 | { | 1385 | { |
1418 | // Only update the position of single objects and linkset roots | 1386 | // A temporary kludge to suppress the rotational effects introduced on vehicles by Bullet |
1419 | if (Linkset.IsRoot(this)) | 1387 | // TODO: handle physics introduced by Bullet with computed vehicle physics. |
1388 | if (_vehicle.IsActive) | ||
1420 | { | 1389 | { |
1421 | base.RequestPhysicsterseUpdate(); | 1390 | entprop.RotationalVelocity = OMV.Vector3.Zero; |
1422 | } | 1391 | } |
1423 | } | ||
1424 | */ | ||
1425 | |||
1426 | // Don't check for damping here -- it's done in BulletSim and SceneObjectPart. | ||
1427 | 1392 | ||
1428 | // Updates only for individual prims and for the root object of a linkset. | ||
1429 | if (Linkset.IsRoot(this)) | ||
1430 | { | ||
1431 | // Assign directly to the local variables so the normal set action does not happen | 1393 | // Assign directly to the local variables so the normal set action does not happen |
1432 | _position = entprop.Position; | 1394 | _position = entprop.Position; |
1433 | _orientation = entprop.Rotation; | 1395 | _orientation = entprop.Rotation; |