diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 27 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs | 28 |
3 files changed, 46 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 40ebed1..bb76717 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11631,8 +11631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11631 | 11631 | ||
11632 | udata.scale = new Vector3(block.Data, 0); | 11632 | udata.scale = new Vector3(block.Data, 0); |
11633 | 11633 | ||
11634 | // udata.change = ObjectChangeType.groupS; | 11634 | udata.change = ObjectChangeType.groupS; |
11635 | udata.change = ObjectChangeType.primS; // to conform to current SL | ||
11636 | updatehandler(localId, udata, this); | 11635 | updatehandler(localId, udata, this); |
11637 | 11636 | ||
11638 | break; | 11637 | break; |
@@ -11643,8 +11642,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11643 | udata.position = new Vector3(block.Data, 0); | 11642 | udata.position = new Vector3(block.Data, 0); |
11644 | udata.scale = new Vector3(block.Data, 12); | 11643 | udata.scale = new Vector3(block.Data, 12); |
11645 | 11644 | ||
11646 | // udata.change = ObjectChangeType.groupPS; | 11645 | udata.change = ObjectChangeType.groupPS; |
11647 | udata.change = ObjectChangeType.primPS; // to conform to current SL | ||
11648 | updatehandler(localId, udata, this); | 11646 | updatehandler(localId, udata, this); |
11649 | break; | 11647 | break; |
11650 | 11648 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 982913a..debb164 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1276,9 +1276,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
1276 | { | 1276 | { |
1277 | if (m_parentScene.Permissions.CanEditObject(grp.UUID, remoteClient.AgentId)) | 1277 | if (m_parentScene.Permissions.CanEditObject(grp.UUID, remoteClient.AgentId)) |
1278 | { | 1278 | { |
1279 | // These two are exceptions SL makes in the interpretation | ||
1280 | // of the change flags. Must check them here because otherwise | ||
1281 | // the group flag (see below) would be lost | ||
1282 | if (data.change == ObjectChangeType.groupS) | ||
1283 | data.change = ObjectChangeType.primS; | ||
1284 | if (data.change == ObjectChangeType.groupPS) | ||
1285 | data.change = ObjectChangeType.primPS; | ||
1279 | part.StoreUndoState(data.change); // lets test only saving what we changed | 1286 | part.StoreUndoState(data.change); // lets test only saving what we changed |
1280 | grp.doChangeObject(part, (ObjectChangeData)data); | 1287 | grp.doChangeObject(part, (ObjectChangeData)data); |
1281 | } | 1288 | } |
1289 | else | ||
1290 | { | ||
1291 | // Is this any kind of group operation? | ||
1292 | if ((data.change & ObjectChangeType.Group) != 0) | ||
1293 | { | ||
1294 | // Is a move and/or rotation requested? | ||
1295 | if ((data.change & (ObjectChangeType.Position | ObjectChangeType.Rotation)) != 0) | ||
1296 | { | ||
1297 | // Are we allowed to move it? | ||
1298 | if (m_parentScene.Permissions.CanMoveObject(grp.UUID, remoteClient.AgentId)) | ||
1299 | { | ||
1300 | // Strip all but move and rotation from request | ||
1301 | data.change &= (ObjectChangeType.Group | ObjectChangeType.Position | ObjectChangeType.Rotation); | ||
1302 | |||
1303 | part.StoreUndoState(data.change); | ||
1304 | grp.doChangeObject(part, (ObjectChangeData)data); | ||
1305 | } | ||
1306 | } | ||
1307 | } | ||
1308 | } | ||
1282 | } | 1309 | } |
1283 | } | 1310 | } |
1284 | } | 1311 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs index 9fefc4e..8f2feba 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs | |||
@@ -118,6 +118,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
118 | 118 | ||
119 | // auxiliar | 119 | // auxiliar |
120 | private float m_lmEfect = 0; // current linear motor eficiency | 120 | private float m_lmEfect = 0; // current linear motor eficiency |
121 | private float m_lmDecay = 1.0f; | ||
121 | private float m_amEfect = 0; // current angular motor eficiency | 122 | private float m_amEfect = 0; // current angular motor eficiency |
122 | private float m_ffactor = 1.0f; | 123 | private float m_ffactor = 1.0f; |
123 | 124 | ||
@@ -155,6 +156,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
155 | 156 | ||
156 | m_linearMotorDecayTimescale = vd.m_linearMotorDecayTimescale; | 157 | m_linearMotorDecayTimescale = vd.m_linearMotorDecayTimescale; |
157 | if (m_linearMotorDecayTimescale < m_timestep) m_linearMotorDecayTimescale = m_timestep; | 158 | if (m_linearMotorDecayTimescale < m_timestep) m_linearMotorDecayTimescale = m_timestep; |
159 | m_linearMotorDecayTimescale += 0.2f; | ||
158 | m_linearMotorDecayTimescale *= m_invtimestep; | 160 | m_linearMotorDecayTimescale *= m_invtimestep; |
159 | 161 | ||
160 | m_linearMotorTimescale = vd.m_linearMotorTimescale; | 162 | m_linearMotorTimescale = vd.m_linearMotorTimescale; |
@@ -208,6 +210,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
208 | m_referenceFrame = vd.m_referenceFrame; | 210 | m_referenceFrame = vd.m_referenceFrame; |
209 | 211 | ||
210 | m_lmEfect = 0; | 212 | m_lmEfect = 0; |
213 | m_lmDecay = (1.0f - 1.0f / m_linearMotorDecayTimescale); | ||
211 | m_amEfect = 0; | 214 | m_amEfect = 0; |
212 | m_ffactor = 1.0f; | 215 | m_ffactor = 1.0f; |
213 | } | 216 | } |
@@ -279,7 +282,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
279 | case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE: | 282 | case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE: |
280 | if (pValue < m_timestep) pValue = m_timestep; | 283 | if (pValue < m_timestep) pValue = m_timestep; |
281 | else if (pValue > 120) pValue = 120; | 284 | else if (pValue > 120) pValue = 120; |
282 | m_linearMotorDecayTimescale = pValue * m_invtimestep; | 285 | m_linearMotorDecayTimescale = (0.2f +pValue) * m_invtimestep; |
283 | break; | 286 | break; |
284 | case Vehicle.LINEAR_MOTOR_TIMESCALE: | 287 | case Vehicle.LINEAR_MOTOR_TIMESCALE: |
285 | if (pValue < m_timestep) pValue = m_timestep; | 288 | if (pValue < m_timestep) pValue = m_timestep; |
@@ -318,9 +321,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
318 | case Vehicle.LINEAR_MOTOR_DIRECTION: | 321 | case Vehicle.LINEAR_MOTOR_DIRECTION: |
319 | m_linearMotorDirection = new Vector3(pValue, pValue, pValue); | 322 | m_linearMotorDirection = new Vector3(pValue, pValue, pValue); |
320 | len = m_linearMotorDirection.Length(); | 323 | len = m_linearMotorDirection.Length(); |
321 | if (len > 30.0f) | 324 | if (len > 100.0f) |
322 | m_linearMotorDirection *= (30.0f / len); | 325 | m_linearMotorDirection *= (100.0f / len); |
323 | m_lmEfect = 1.0f; // turn it on | 326 | m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; |
327 | m_lmEfect = 1.0f / m_linearMotorTimescale; // turn it on | ||
324 | m_ffactor = 0.01f; | 328 | m_ffactor = 0.01f; |
325 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 329 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) |
326 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 330 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
@@ -368,9 +372,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
368 | case Vehicle.LINEAR_MOTOR_DIRECTION: | 372 | case Vehicle.LINEAR_MOTOR_DIRECTION: |
369 | m_linearMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); | 373 | m_linearMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); |
370 | len = m_linearMotorDirection.Length(); | 374 | len = m_linearMotorDirection.Length(); |
371 | if (len > 30.0f) | 375 | if (len > 100.0f) |
372 | m_linearMotorDirection *= (30.0f / len); | 376 | m_linearMotorDirection *= (100.0f / len); |
373 | m_lmEfect = 1.0f; // turn it on | 377 | m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; |
378 | m_lmEfect = 1.0f / m_linearMotorTimescale; // turn it on | ||
374 | m_ffactor = 0.01f; | 379 | m_ffactor = 0.01f; |
375 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 380 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) |
376 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 381 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
@@ -603,12 +608,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
603 | // VehicleFlag.HOVER_GLOBAL_HEIGHT); | 608 | // VehicleFlag.HOVER_GLOBAL_HEIGHT); |
604 | break; | 609 | break; |
605 | } | 610 | } |
606 | 611 | m_lmDecay = (1.0f - 1.0f / m_linearMotorDecayTimescale); | |
607 | }//end SetDefaultsForType | 612 | }//end SetDefaultsForType |
608 | 613 | ||
609 | internal void Stop() | 614 | internal void Stop() |
610 | { | 615 | { |
611 | m_lmEfect = 0; | 616 | m_lmEfect = 0; |
617 | m_lmDecay = 1.0f; | ||
612 | m_amEfect = 0; | 618 | m_amEfect = 0; |
613 | m_ffactor = 1f; | 619 | m_ffactor = 1f; |
614 | } | 620 | } |
@@ -739,10 +745,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
739 | Vector3 curLocalAngVel = curAngVel * irotq; // current angular velocity in local | 745 | Vector3 curLocalAngVel = curAngVel * irotq; // current angular velocity in local |
740 | 746 | ||
741 | // linear motor | 747 | // linear motor |
742 | if (m_lmEfect > 0.01 && m_linearMotorTimescale < 1000) | 748 | if (m_lmEfect > 0.001 && m_linearMotorTimescale < 1000) |
743 | { | 749 | { |
744 | tmpV = m_linearMotorDirection - curLocalVel; // velocity error | 750 | tmpV = m_linearMotorDirection - curLocalVel; // velocity error |
745 | tmpV *= m_lmEfect / m_linearMotorTimescale; // error to correct in this timestep | 751 | tmpV *= m_lmEfect; // error to correct in this timestep |
746 | tmpV *= rotq; // to world | 752 | tmpV *= rotq; // to world |
747 | 753 | ||
748 | if ((m_flags & VehicleFlag.LIMIT_MOTOR_UP) != 0) | 754 | if ((m_flags & VehicleFlag.LIMIT_MOTOR_UP) != 0) |
@@ -760,7 +766,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
760 | force.Y += tmpV.Y; | 766 | force.Y += tmpV.Y; |
761 | force.Z += tmpV.Z; | 767 | force.Z += tmpV.Z; |
762 | } | 768 | } |
763 | m_lmEfect *= (1.0f - 1.0f / m_linearMotorDecayTimescale); | 769 | m_lmEfect *= m_lmDecay; |
764 | 770 | ||
765 | m_ffactor = 0.01f + 1e-4f * curVel.LengthSquared(); | 771 | m_ffactor = 0.01f + 1e-4f * curVel.LengthSquared(); |
766 | } | 772 | } |