BulletSim: fix boats floating low by removing LIMIT_MOTOR_UP flag from TYPE_BOAT definition.
parent
24b3b4df2e
commit
2ccd4c1302
|
@ -445,9 +445,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin
|
||||||
m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY
|
m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY
|
||||||
| VehicleFlag.HOVER_GLOBAL_HEIGHT
|
| VehicleFlag.HOVER_GLOBAL_HEIGHT
|
||||||
| VehicleFlag.LIMIT_ROLL_ONLY
|
| VehicleFlag.LIMIT_ROLL_ONLY
|
||||||
|
| VehicleFlag.LIMIT_MOTOR_UP
|
||||||
| VehicleFlag.HOVER_UP_ONLY);
|
| VehicleFlag.HOVER_UP_ONLY);
|
||||||
m_flags |= (VehicleFlag.NO_DEFLECTION_UP
|
m_flags |= (VehicleFlag.NO_DEFLECTION_UP
|
||||||
| VehicleFlag.LIMIT_MOTOR_UP
|
|
||||||
| VehicleFlag.HOVER_WATER_ONLY);
|
| VehicleFlag.HOVER_WATER_ONLY);
|
||||||
break;
|
break;
|
||||||
case Vehicle.TYPE_AIRPLANE:
|
case Vehicle.TYPE_AIRPLANE:
|
||||||
|
@ -805,6 +805,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// From http://wiki.secondlife.com/wiki/LlSetVehicleFlags :
|
||||||
|
// Prevent ground vehicles from motoring into the sky.This flag has a subtle effect when
|
||||||
|
// used with conjunction with banking: the strength of the banking will decay when the
|
||||||
|
// vehicle no longer experiences collisions. The decay timescale is the same as
|
||||||
|
// VEHICLE_BANKING_TIMESCALE. This is to help prevent ground vehicles from steering
|
||||||
|
// when they are in mid jump.
|
||||||
|
// TODO: this code is wrong. Also, what should it do for boats?
|
||||||
public Vector3 ComputeLinearMotorUp(float pTimestep, Vector3 pos, float terrainHeight)
|
public Vector3 ComputeLinearMotorUp(float pTimestep, Vector3 pos, float terrainHeight)
|
||||||
{
|
{
|
||||||
Vector3 ret = Vector3.Zero;
|
Vector3 ret = Vector3.Zero;
|
||||||
|
@ -818,10 +825,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin
|
||||||
// downForce = new Vector3(0, 0, -distanceAboveGround / m_bankingTimescale);
|
// downForce = new Vector3(0, 0, -distanceAboveGround / m_bankingTimescale);
|
||||||
ret = new Vector3(0, 0, -distanceAboveGround);
|
ret = new Vector3(0, 0, -distanceAboveGround);
|
||||||
}
|
}
|
||||||
// TODO: this calculation is all wrong. From the description at
|
// TODO: this calculation is wrong. From the description at
|
||||||
// (http://wiki.secondlife.com/wiki/Category:LSL_Vehicle), the downForce
|
// (http://wiki.secondlife.com/wiki/Category:LSL_Vehicle), the downForce
|
||||||
// has a decay factor. This says this force should
|
// has a decay factor. This says this force should
|
||||||
// be computed with a motor.
|
// be computed with a motor.
|
||||||
|
// TODO: add interaction with banking.
|
||||||
VDetailLog("{0},MoveLinear,limitMotorUp,distAbove={1},downForce={2}",
|
VDetailLog("{0},MoveLinear,limitMotorUp,distAbove={1},downForce={2}",
|
||||||
Prim.LocalID, distanceAboveGround, ret);
|
Prim.LocalID, distanceAboveGround, ret);
|
||||||
}
|
}
|
||||||
|
@ -864,7 +872,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin
|
||||||
Vector3 angularMotorContribution = m_angularMotor.Step(pTimestep);
|
Vector3 angularMotorContribution = m_angularMotor.Step(pTimestep);
|
||||||
|
|
||||||
// ==================================================================
|
// ==================================================================
|
||||||
// NO_DEFLECTION_UP says angular motion should not add any pitch or roll movement
|
// From http://wiki.secondlife.com/wiki/LlSetVehicleFlags :
|
||||||
|
// This flag prevents linear deflection parallel to world z-axis. This is useful
|
||||||
|
// for preventing ground vehicles with large linear deflection, like bumper cars,
|
||||||
|
// from climbing their linear deflection into the sky.
|
||||||
|
// That is, NO_DEFLECTION_UP says angular motion should not add any pitch or roll movement
|
||||||
if ((m_flags & (VehicleFlag.NO_DEFLECTION_UP)) != 0)
|
if ((m_flags & (VehicleFlag.NO_DEFLECTION_UP)) != 0)
|
||||||
{
|
{
|
||||||
angularMotorContribution.X = 0f;
|
angularMotorContribution.X = 0f;
|
||||||
|
|
Loading…
Reference in New Issue