aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorUbitUmarov2015-12-01 12:11:48 +0000
committerUbitUmarov2015-12-01 12:11:48 +0000
commite37c4e878ca28fd3afa5ad71364e0d66be6621af (patch)
treea79a38ca584e457b46f9f6887f93a781f9a04832 /OpenSim/Region/ScriptEngine/Shared
parentsome changes due to lookAt and RotLookAt (diff)
downloadopensim-SC_OLD-e37c4e878ca28fd3afa5ad71364e0d66be6621af.zip
opensim-SC_OLD-e37c4e878ca28fd3afa5ad71364e0d66be6621af.tar.gz
opensim-SC_OLD-e37c4e878ca28fd3afa5ad71364e0d66be6621af.tar.bz2
opensim-SC_OLD-e37c4e878ca28fd3afa5ad71364e0d66be6621af.tar.xz
more changes on lookAt and RotLookAt; do something in attachments
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 8d59c2d..a2abbeb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3569,7 +3569,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3569 // and rotate so Z points to target with X below horizont 3569 // and rotate so Z points to target with X below horizont
3570 LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up); 3570 LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up);
3571 3571
3572 if (m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) 3572 SceneObjectGroup sog = m_host.ParentGroup;
3573 if(sog == null || sog.IsDeleted)
3574 return;
3575
3576 if (!sog.UsesPhysics || sog.IsAttachment)
3573 { 3577 {
3574 // Do nothing if either value is 0 (this has been checked in SL) 3578 // Do nothing if either value is 0 (this has been checked in SL)
3575 if (strength <= 0.0 || damping <= 0.0) 3579 if (strength <= 0.0 || damping <= 0.0)
@@ -3585,7 +3589,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3585 return; 3589 return;
3586 } 3590 }
3587 3591
3588 m_host.StartLookAt(rot, (float)strength, (float)damping); 3592 sog.StartLookAt(rot, (float)strength, (float)damping);
3589 } 3593 }
3590 } 3594 }
3591 3595
@@ -3991,15 +3995,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3991 3995
3992 // Per discussion with Melanie, for non-physical objects llLookAt appears to simply 3996 // Per discussion with Melanie, for non-physical objects llLookAt appears to simply
3993 // set the rotation of the object, copy that behavior 3997 // set the rotation of the object, copy that behavior
3994 PhysicsActor pa = m_host.PhysActor; 3998 SceneObjectGroup sog = m_host.ParentGroup;
3999 if(sog == null || sog.IsDeleted)
4000 return;
3995 4001
3996 if (strength == 0 || pa == null || !pa.IsPhysical) 4002 if (strength == 0 || !sog.UsesPhysics || sog.IsAttachment)
3997 { 4003 {
3998 llSetLocalRot(target); 4004 llSetLocalRot(target);
3999 } 4005 }
4000 else 4006 else
4001 { 4007 {
4002 m_host.RotLookAt(target, (float)strength, (float)damping); 4008 sog.RotLookAt(target, (float)strength, (float)damping);
4003 } 4009 }
4004 } 4010 }
4005 4011