From e1a2c44ebe8f10cf00a14578e44b000ff16b68df Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Fri, 13 Jan 2012 14:48:56 -0800 Subject: Cleaned up the LookAt code in SOP and SOG. Added support for incrementally rotating physical objects. This does not use physics. Currently the rate of change is determined as 1 / (PI * Strength). --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 30145c7..ab175ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2865,13 +2865,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Per discussion with Melanie, for non-physical objects llLookAt appears to simply // set the rotation of the object, copy that behavior - if (m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) + if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) { llSetRot(rot); } else { - m_host.startLookAt(Rot2Quaternion(rot), (float)damping, (float)strength); + m_host.StartLookAt(Rot2Quaternion(rot), (float)strength, (float)damping); } } @@ -3251,13 +3251,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Per discussion with Melanie, for non-physical objects llLookAt appears to simply // set the rotation of the object, copy that behavior - if (m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) + if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) { llSetLocalRot(target); } else { - m_host.RotLookAt(Rot2Quaternion(target), (float)damping, (float)strength); + m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping); } } -- cgit v1.1