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.
parent
8b861e880a
commit
905d7c43ad
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue