diff options
author | Teravus Ovares | 2008-05-06 00:23:19 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-06 00:23:19 +0000 |
commit | 240e8646dac402068930065c1fb792e647f1ce4b (patch) | |
tree | 10064eea011ac7155c947b11a64bcc650feb6dbb /OpenSim/Region/Environment/Scenes | |
parent | * Refactor: Break out permissions code into a separate region PermissionsModule (diff) | |
download | opensim-SC_OLD-240e8646dac402068930065c1fb792e647f1ce4b.zip opensim-SC_OLD-240e8646dac402068930065c1fb792e647f1ce4b.tar.gz opensim-SC_OLD-240e8646dac402068930065c1fb792e647f1ce4b.tar.bz2 opensim-SC_OLD-240e8646dac402068930065c1fb792e647f1ce4b.tar.xz |
* If you llApplyImpulse on an attachment, it applies impulse on the avatar, not the attachment.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 8 |
2 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2e44c54..2bc7fd3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1301,8 +1301,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
1301 | { | 1301 | { |
1302 | if (rootpart.PhysActor != null) | 1302 | if (rootpart.PhysActor != null) |
1303 | { | 1303 | { |
1304 | rootpart.PhysActor.AddForce(impulse); | 1304 | if (rootpart.m_IsAttachment) |
1305 | m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); | 1305 | { |
1306 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.m_attachedAvatar); | ||
1307 | if (avatar != null) | ||
1308 | { | ||
1309 | avatar.PushForce(impulse); | ||
1310 | } | ||
1311 | } | ||
1312 | else | ||
1313 | { | ||
1314 | rootpart.PhysActor.AddForce(impulse,true); | ||
1315 | m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); | ||
1316 | } | ||
1306 | } | 1317 | } |
1307 | } | 1318 | } |
1308 | } | 1319 | } |
@@ -1909,7 +1920,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1909 | LLVector3 llmoveforce = pos - AbsolutePosition; | 1920 | LLVector3 llmoveforce = pos - AbsolutePosition; |
1910 | PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z); | 1921 | PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z); |
1911 | grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; | 1922 | grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; |
1912 | m_rootPart.PhysActor.AddForce(grabforce); | 1923 | m_rootPart.PhysActor.AddForce(grabforce,true); |
1913 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 1924 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
1914 | } | 1925 | } |
1915 | else | 1926 | else |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index fcd93d8..aefecd0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -2389,5 +2389,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2389 | 2389 | ||
2390 | info.AddValue("m_knownPrimUUID", knownPrimUUID_work); | 2390 | info.AddValue("m_knownPrimUUID", knownPrimUUID_work); |
2391 | } | 2391 | } |
2392 | |||
2393 | internal void PushForce(PhysicsVector impulse) | ||
2394 | { | ||
2395 | if (PhysicsActor != null) | ||
2396 | { | ||
2397 | PhysicsActor.AddForce(impulse,true); | ||
2398 | } | ||
2399 | } | ||
2392 | } | 2400 | } |
2393 | } | 2401 | } |