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 | |
parent | * Refactor: Break out permissions code into a separate region PermissionsModule (diff) | |
download | opensim-SC-240e8646dac402068930065c1fb792e647f1ce4b.zip opensim-SC-240e8646dac402068930065c1fb792e647f1ce4b.tar.gz opensim-SC-240e8646dac402068930065c1fb792e647f1ce4b.tar.bz2 opensim-SC-240e8646dac402068930065c1fb792e647f1ce4b.tar.xz |
* If you llApplyImpulse on an attachment, it applies impulse on the avatar, not the attachment.
Diffstat (limited to '')
9 files changed, 51 insertions, 21 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 | } |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 0d54dad..eecd115 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
384 | _acceleration = accel; | 384 | _acceleration = accel; |
385 | } | 385 | } |
386 | 386 | ||
387 | public override void AddForce(PhysicsVector force) | 387 | public override void AddForce(PhysicsVector force, bool pushforce) |
388 | { | 388 | { |
389 | } | 389 | } |
390 | 390 | ||
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 9bd5f08..8a79dd6 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -917,7 +917,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
917 | set { } | 917 | set { } |
918 | } | 918 | } |
919 | 919 | ||
920 | public override void AddForce(PhysicsVector force) | 920 | public override void AddForce(PhysicsVector force, bool pushforce) |
921 | { | 921 | { |
922 | } | 922 | } |
923 | 923 | ||
@@ -1134,9 +1134,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1134 | base.SetAcceleration(accel); | 1134 | base.SetAcceleration(accel); |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | public override void AddForce(PhysicsVector force) | 1137 | public override void AddForce(PhysicsVector force, bool pushforce) |
1138 | { | 1138 | { |
1139 | base.AddForce(force); | 1139 | base.AddForce(force, pushforce); |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | public override void SetMomentum(PhysicsVector momentum) | 1142 | public override void SetMomentum(PhysicsVector momentum) |
@@ -1343,9 +1343,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1343 | } | 1343 | } |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | public override void AddForce(PhysicsVector force) | 1346 | public override void AddForce(PhysicsVector force, bool pushforce) |
1347 | { | 1347 | { |
1348 | base.AddForce(force); | 1348 | base.AddForce(force,pushforce); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | public override void SetMomentum(PhysicsVector momentum) | 1351 | public override void SetMomentum(PhysicsVector momentum) |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 046c285..c1dc91b 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -196,7 +196,7 @@ namespace OpenSim.Region.Physics.Manager | |||
196 | public abstract float PIDTau { set; } | 196 | public abstract float PIDTau { set; } |
197 | 197 | ||
198 | 198 | ||
199 | public abstract void AddForce(PhysicsVector force); | 199 | public abstract void AddForce(PhysicsVector force, bool pushforce); |
200 | public abstract void SetMomentum(PhysicsVector momentum); | 200 | public abstract void SetMomentum(PhysicsVector momentum); |
201 | public abstract void SubscribeEvents(int ms); | 201 | public abstract void SubscribeEvents(int ms); |
202 | public abstract void UnSubscribeEvents(); | 202 | public abstract void UnSubscribeEvents(); |
@@ -365,7 +365,7 @@ namespace OpenSim.Region.Physics.Manager | |||
365 | { | 365 | { |
366 | } | 366 | } |
367 | 367 | ||
368 | public override void AddForce(PhysicsVector force) | 368 | public override void AddForce(PhysicsVector force, bool pushforce) |
369 | { | 369 | { |
370 | } | 370 | } |
371 | 371 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 3d0855f..17e041d 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -610,13 +610,24 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
610 | /// The PID controller takes this target velocity and tries to make it a reality | 610 | /// The PID controller takes this target velocity and tries to make it a reality |
611 | /// </summary> | 611 | /// </summary> |
612 | /// <param name="force"></param> | 612 | /// <param name="force"></param> |
613 | public override void AddForce(PhysicsVector force) | 613 | public override void AddForce(PhysicsVector force, bool pushforce) |
614 | { | 614 | { |
615 | m_pidControllerActive = true; | 615 | if (pushforce) |
616 | _target_velocity.X += force.X; | 616 | { |
617 | _target_velocity.Y += force.Y; | 617 | m_pidControllerActive = false; |
618 | _target_velocity.Z += force.Z; | 618 | doForce(force); |
619 | 619 | ||
620 | //_target_velocity.X += force.X; | ||
621 | // _target_velocity.Y += force.Y; | ||
622 | //_target_velocity.Z += force.Z; | ||
623 | } | ||
624 | else | ||
625 | { | ||
626 | m_pidControllerActive = true; | ||
627 | _target_velocity.X += force.X; | ||
628 | _target_velocity.Y += force.Y; | ||
629 | _target_velocity.Z += force.Z; | ||
630 | } | ||
620 | //m_lastUpdateSent = false; | 631 | //m_lastUpdateSent = false; |
621 | } | 632 | } |
622 | 633 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 4e1696d..cf9dc5d 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -1884,7 +1884,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1884 | _acceleration = accel; | 1884 | _acceleration = accel; |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | public override void AddForce(PhysicsVector force) | 1887 | public override void AddForce(PhysicsVector force, bool pushforce) |
1888 | { | 1888 | { |
1889 | m_forcelist.Add(force); | 1889 | m_forcelist.Add(force); |
1890 | m_taintforce = true; | 1890 | m_taintforce = true; |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 836e620..96e67d1 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | |||
@@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
513 | _acceleration = accel; | 513 | _acceleration = accel; |
514 | } | 514 | } |
515 | 515 | ||
516 | public override void AddForce(PhysicsVector force) | 516 | public override void AddForce(PhysicsVector force, bool pushforce) |
517 | { | 517 | { |
518 | } | 518 | } |
519 | 519 | ||
@@ -686,7 +686,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
686 | _acceleration = accel; | 686 | _acceleration = accel; |
687 | } | 687 | } |
688 | 688 | ||
689 | public override void AddForce(PhysicsVector force) | 689 | public override void AddForce(PhysicsVector force, bool pushforce) |
690 | { | 690 | { |
691 | } | 691 | } |
692 | 692 | ||
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 49fe1b5..712d10e 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -378,7 +378,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
378 | _acceleration = accel; | 378 | _acceleration = accel; |
379 | } | 379 | } |
380 | 380 | ||
381 | public override void AddForce(PhysicsVector force) | 381 | public override void AddForce(PhysicsVector force, bool pushforce) |
382 | { | 382 | { |
383 | } | 383 | } |
384 | 384 | ||
@@ -625,7 +625,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
625 | _acceleration = accel; | 625 | _acceleration = accel; |
626 | } | 626 | } |
627 | 627 | ||
628 | public override void AddForce(PhysicsVector force) | 628 | public override void AddForce(PhysicsVector force, bool pushforce) |
629 | { | 629 | { |
630 | } | 630 | } |
631 | 631 | ||