aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-12-01 10:15:38 +0000
committerUbitUmarov2015-12-01 10:15:38 +0000
commita9e58d61754ef4f3cf0c586ad343146418307c10 (patch)
tree1ff0a248279830ac38c3694985540b975e8ea631 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
parentMerge branch 'master' of opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-a9e58d61754ef4f3cf0c586ad343146418307c10.zip
opensim-SC_OLD-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.gz
opensim-SC_OLD-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.bz2
opensim-SC_OLD-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.xz
some changes due to lookAt and RotLookAt
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs63
1 files changed, 42 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 52f9b51..e8d976d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -458,6 +458,7 @@ namespace OpenSim.Region.Framework.Scenes
458 Velocity = Vector3.Zero; 458 Velocity = Vector3.Zero;
459 AngularVelocity = Vector3.Zero; 459 AngularVelocity = Vector3.Zero;
460 Acceleration = Vector3.Zero; 460 Acceleration = Vector3.Zero;
461 APIDActive = false;
461 Flags = 0; 462 Flags = 0;
462 CreateSelected = true; 463 CreateSelected = true;
463 464
@@ -1713,12 +1714,9 @@ namespace OpenSim.Region.Framework.Scenes
1713 { 1714 {
1714 if (PhysActor != null) 1715 if (PhysActor != null)
1715 { 1716 {
1716 Velocity = new Vector3(0, 0, 0);
1717 Acceleration = new Vector3(0, 0, 0);
1718 if (ParentGroup.RootPart == this)
1719 AngularVelocity = new Vector3(0, 0, 0);
1720 ParentGroup.Scene.RemovePhysicalPrim(1); 1717 ParentGroup.Scene.RemovePhysicalPrim(1);
1721 RemoveFromPhysics(); 1718 RemoveFromPhysics();
1719 Stop();
1722 } 1720 }
1723 } 1721 }
1724 else if (PhysActor == null) 1722 else if (PhysActor == null)
@@ -2350,9 +2348,7 @@ namespace OpenSim.Region.Framework.Scenes
2350 ParentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed? 2348 ParentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed?
2351 2349
2352 // make sure client isn't interpolating the joint proxy object 2350 // make sure client isn't interpolating the joint proxy object
2353 Velocity = Vector3.Zero; 2351 Stop();
2354 AngularVelocity = Vector3.Zero;
2355 Acceleration = Vector3.Zero;
2356 } 2352 }
2357 } 2353 }
2358 } 2354 }
@@ -2391,8 +2387,8 @@ namespace OpenSim.Region.Framework.Scenes
2391 2387
2392 Velocity = new Vector3(0, 0, 0); 2388 Velocity = new Vector3(0, 0, 0);
2393 Acceleration = new Vector3(0, 0, 0); 2389 Acceleration = new Vector3(0, 0, 0);
2394 if (ParentGroup.RootPart == this) 2390 AngularVelocity = new Vector3(0, 0, 0);
2395 AngularVelocity = new Vector3(0, 0, 0); 2391 APIDActive = false;
2396 2392
2397 if (pa.Phantom && !VolumeDetectActive) 2393 if (pa.Phantom && !VolumeDetectActive)
2398 { 2394 {
@@ -2994,7 +2990,7 @@ namespace OpenSim.Region.Framework.Scenes
2994 } 2990 }
2995 //ParentGroup.RootPart.m_groupPosition = newpos; 2991 //ParentGroup.RootPart.m_groupPosition = newpos;
2996 } 2992 }
2997/* ubit: there are no flexible links 2993/*
2998 if (pa != null && ParentID != 0 && ParentGroup != null) 2994 if (pa != null && ParentID != 0 && ParentGroup != null)
2999 { 2995 {
3000 // Special case where a child object is requesting property updates. 2996 // Special case where a child object is requesting property updates.
@@ -3095,6 +3091,14 @@ namespace OpenSim.Region.Framework.Scenes
3095 3091
3096 public void RotLookAt(Quaternion target, float strength, float damping) 3092 public void RotLookAt(Quaternion target, float strength, float damping)
3097 { 3093 {
3094 // non physical is done on LSL
3095 // physical is a rootpart thing
3096 if(ParentGroup.IsDeleted)
3097 return;
3098
3099 if(ParentGroup.RootPart != this)
3100 ParentGroup.RootPart.RotLookAt(target, strength, damping);
3101
3098 if (ParentGroup.IsAttachment) 3102 if (ParentGroup.IsAttachment)
3099 { 3103 {
3100 /* 3104 /*
@@ -3125,15 +3129,30 @@ namespace OpenSim.Region.Framework.Scenes
3125 3129
3126 public void StartLookAt(Quaternion target, float strength, float damping) 3130 public void StartLookAt(Quaternion target, float strength, float damping)
3127 { 3131 {
3132 // non physical is done on LSL
3133 // physical is a rootpart thing
3134 if(ParentGroup.IsDeleted)
3135 return;
3136
3137 if(ParentGroup.RootPart != this)
3138 ParentGroup.RootPart.RotLookAt(target, strength, damping);
3139
3128 RotLookAt(target,strength,damping); 3140 RotLookAt(target,strength,damping);
3129 } 3141 }
3130 3142
3131 public void StopLookAt() 3143 public void StopLookAt()
3132 { 3144 {
3133 APIDActive = false; 3145 if(ParentGroup.IsDeleted)
3134 } 3146 return;
3135 3147
3148 if(ParentGroup.RootPart != this)
3149 ParentGroup.RootPart.StopLookAt();
3136 3150
3151 if(APIDActive)
3152 AngularVelocity = Vector3.Zero;
3153
3154 APIDActive = false;
3155 }
3137 3156
3138 public void ScheduleFullUpdateIfNone() 3157 public void ScheduleFullUpdateIfNone()
3139 { 3158 {
@@ -3543,7 +3562,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
3543 } 3562 }
3544 } 3563 }
3545 3564
3546
3547 public int VehicleType 3565 public int VehicleType
3548 { 3566 {
3549 get 3567 get
@@ -4733,10 +4751,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
4733 RemoveFromPhysics(); 4751 RemoveFromPhysics();
4734 } 4752 }
4735 4753
4736 Velocity = new Vector3(0, 0, 0); 4754 Stop();
4737 Acceleration = new Vector3(0, 0, 0);
4738 if (ParentGroup.RootPart == this)
4739 AngularVelocity = new Vector3(0, 0, 0);
4740 } 4755 }
4741 4756
4742 else 4757 else
@@ -4909,17 +4924,15 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
4909 } 4924 }
4910 } 4925 }
4911 4926
4912 if (applyDynamics) 4927 if (applyDynamics && LocalId != ParentGroup.RootPart.LocalId)
4913 // do independent of isphysical so parameters get setted (at least some) 4928 // do independent of isphysical so parameters get setted (at least some)
4914 { 4929 {
4915 Velocity = velocity; 4930 Velocity = velocity;
4916 AngularVelocity = rotationalVelocity; 4931 AngularVelocity = rotationalVelocity;
4917// pa.Velocity = velocity;
4918 pa.RotationalVelocity = rotationalVelocity; 4932 pa.RotationalVelocity = rotationalVelocity;
4919 4933
4920 // if not vehicle and root part apply force and torque 4934 // if not vehicle and root part apply force and torque
4921 if ((m_vehicleParams == null || m_vehicleParams.Type == Vehicle.TYPE_NONE) 4935 if ((m_vehicleParams == null || m_vehicleParams.Type == Vehicle.TYPE_NONE))
4922 && LocalId == ParentGroup.RootPart.LocalId)
4923 { 4936 {
4924 pa.Force = Force; 4937 pa.Force = Force;
4925 pa.Torque = Torque; 4938 pa.Torque = Torque;
@@ -5629,5 +5642,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
5629 return m_sittingAvatars.Count; 5642 return m_sittingAvatars.Count;
5630 } 5643 }
5631 } 5644 }
5645
5646 public void Stop()
5647 {
5648 Velocity = Vector3.Zero;
5649 AngularVelocity = Vector3.Zero;
5650 Acceleration = Vector3.Zero;
5651 APIDActive = false;
5652 }
5632 } 5653 }
5633} 5654}