BulletSim: fix vehicles being shot in the air at border crossings because of mis-application of correction to postion for below groundness.

0.7.5-pf-bulletsim
Robert Adams 2012-12-16 22:31:22 -08:00
parent 2b8efa24dd
commit 021623a17d
1 changed files with 5 additions and 2 deletions

View File

@ -871,8 +871,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin
if (VehiclePosition.Z < GetTerrainHeight(VehiclePosition))
{
// TODO: correct position by applying force rather than forcing position.
VehiclePosition += new Vector3(0f, 0f, GetTerrainHeight(VehiclePosition) + 2f);
VDetailLog("{0}, MoveLinear,terrainHeight,terrainHeight={1},pos={2}", Prim.LocalID, GetTerrainHeight(VehiclePosition), VehiclePosition);
Vector3 newPosition = VehiclePosition;
newPosition.Z = GetTerrainHeight(VehiclePosition) + 1f;
VehiclePosition = newPosition;
VDetailLog("{0}, MoveLinear,terrainHeight,terrainHeight={1},pos={2}",
Prim.LocalID, GetTerrainHeight(VehiclePosition), VehiclePosition);
}
return ret;
}