BulletSim: modify LIMIT_MOTOR_UP to limit BOAT types to be at water rather than ground level. This makes boats float at water level better but not perfectly. There probably needs to be some interaction between HOVER and LIMIT_MOTOR_UP.

0.7.5-pf-bulletsim
Robert Adams 2012-12-11 00:35:16 -08:00
parent 8b861e880a
commit 905d7c43ad
1 changed files with 2 additions and 2 deletions

View File

@ -993,8 +993,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
if ((m_flags & (VehicleFlag.LIMIT_MOTOR_UP)) != 0) if ((m_flags & (VehicleFlag.LIMIT_MOTOR_UP)) != 0)
{ {
// If the vehicle is motoring into the sky, get it going back down. float targetHeight = Type == Vehicle.TYPE_BOAT ? GetWaterLevel(VehiclePosition) : GetTerrainHeight(VehiclePosition);
float distanceAboveGround = VehiclePosition.Z - GetTerrainHeight(VehiclePosition); float distanceAboveGround = VehiclePosition.Z - targetHeight;
// Not colliding if the vehicle is off the ground // Not colliding if the vehicle is off the ground
if (!Prim.IsColliding) if (!Prim.IsColliding)
{ {