llLookAt(): reduce and clamp strengh to reduce probability of overshoot
parent
506e62f815
commit
2ed1afd32b
|
@ -4910,10 +4910,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (angle > Math.PI)
|
if (angle > Math.PI)
|
||||||
angle = 2.0f * (float)Math.PI - angle;
|
angle = 2.0f * (float)Math.PI - angle;
|
||||||
|
|
||||||
|
// clamp strength to avoid overshoot
|
||||||
|
float strength = APIDStrength;
|
||||||
|
if (strength > 1.0) strength = 1.0f;
|
||||||
|
|
||||||
// set angular velocity to rotate to desired orientation
|
// set angular velocity to rotate to desired orientation
|
||||||
// with velocity proportional to strength and angle
|
// with velocity proportional to strength and angle
|
||||||
// the factor of 10 seems to make rotation speed closer to LL implementation
|
AngularVelocity = axis * angle * strength * (float)Math.PI;
|
||||||
AngularVelocity = axis * angle * APIDStrength * (float)Math.PI * 10.0f;
|
|
||||||
|
|
||||||
// This ensures that we'll check this object on the next iteration
|
// This ensures that we'll check this object on the next iteration
|
||||||
ParentGroup.QueueForUpdateCheck();
|
ParentGroup.QueueForUpdateCheck();
|
||||||
|
|
Loading…
Reference in New Issue