aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-12-01 12:11:48 +0000
committerUbitUmarov2015-12-01 12:11:48 +0000
commite37c4e878ca28fd3afa5ad71364e0d66be6621af (patch)
treea79a38ca584e457b46f9f6887f93a781f9a04832 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
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/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs58
1 files changed, 28 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e8d976d..33c1c4e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3091,37 +3091,31 @@ namespace OpenSim.Region.Framework.Scenes
3091 3091
3092 public void RotLookAt(Quaternion target, float strength, float damping) 3092 public void RotLookAt(Quaternion target, float strength, float damping)
3093 { 3093 {
3094 // non physical is done on LSL
3095 // physical is a rootpart thing
3096 if(ParentGroup.IsDeleted) 3094 if(ParentGroup.IsDeleted)
3097 return; 3095 return;
3098 3096
3099 if(ParentGroup.RootPart != this) 3097 // for now we only handle physics case
3100 ParentGroup.RootPart.RotLookAt(target, strength, damping); 3098 if(!ParentGroup.UsesPhysics || ParentGroup.IsAttachment)
3099 return;
3101 3100
3102 if (ParentGroup.IsAttachment) 3101 // physical is SOG
3102 if(ParentGroup.RootPart != this)
3103 { 3103 {
3104 /* 3104 ParentGroup.RotLookAt(target, strength, damping);
3105 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); 3105 return;
3106 if (avatar != null)
3107 {
3108 Rotate the Av?
3109 } */
3110 } 3106 }
3111 else
3112 {
3113 APIDDamp = damping;
3114 APIDStrength = strength;
3115 APIDTarget = target;
3116 3107
3117 if (APIDStrength <= 0) 3108 APIDDamp = damping;
3118 { 3109 APIDStrength = strength;
3119 m_log.WarnFormat("[SceneObjectPart] Invalid rotation strength {0}",APIDStrength); 3110 APIDTarget = target;
3120 return; 3111
3121 } 3112 if (APIDStrength <= 0)
3122 3113 {
3123 APIDActive = true; 3114 m_log.WarnFormat("[SceneObjectPart] Invalid rotation strength {0}",APIDStrength);
3115 return;
3124 } 3116 }
3117
3118 APIDActive = true;
3125 3119
3126 // Necessary to get the lookat deltas applied 3120 // Necessary to get the lookat deltas applied
3127 ParentGroup.QueueForUpdateCheck(); 3121 ParentGroup.QueueForUpdateCheck();
@@ -3129,15 +3123,18 @@ namespace OpenSim.Region.Framework.Scenes
3129 3123
3130 public void StartLookAt(Quaternion target, float strength, float damping) 3124 public void StartLookAt(Quaternion target, float strength, float damping)
3131 { 3125 {
3132 // non physical is done on LSL
3133 // physical is a rootpart thing
3134 if(ParentGroup.IsDeleted) 3126 if(ParentGroup.IsDeleted)
3135 return; 3127 return;
3136 3128
3137 if(ParentGroup.RootPart != this) 3129 // non physical is done on LSL
3138 ParentGroup.RootPart.RotLookAt(target, strength, damping); 3130 if(ParentGroup.IsAttachment || !ParentGroup.UsesPhysics)
3131 return;
3139 3132
3140 RotLookAt(target,strength,damping); 3133 // physical is SOG
3134 if(ParentGroup.RootPart != this)
3135 ParentGroup.RotLookAt(target, strength, damping);
3136 else
3137 RotLookAt(target,strength,damping);
3141 } 3138 }
3142 3139
3143 public void StopLookAt() 3140 public void StopLookAt()
@@ -3145,9 +3142,10 @@ namespace OpenSim.Region.Framework.Scenes
3145 if(ParentGroup.IsDeleted) 3142 if(ParentGroup.IsDeleted)
3146 return; 3143 return;
3147 3144
3148 if(ParentGroup.RootPart != this) 3145 if(ParentGroup.RootPart != this && ParentGroup.UsesPhysics)
3149 ParentGroup.RootPart.StopLookAt(); 3146 ParentGroup.StopLookAt();
3150 3147
3148 // just in case do this always
3151 if(APIDActive) 3149 if(APIDActive)
3152 AngularVelocity = Vector3.Zero; 3150 AngularVelocity = Vector3.Zero;
3153 3151