aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-11-13 19:25:51 +0000
committerUbitUmarov2016-11-13 19:25:51 +0000
commit3cb2b3b2d1904523f5981ef775e18dc25f733433 (patch)
tree0760c149ffb0a70578138c4b575b51d351d8bcd1 /OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
parentprevent self call to llSetScriptState(ownname,FALSE) from blocking entire engine (diff)
parentBulletSim: update avatar velocity setting to the new TargetVelocity pattern. (diff)
downloadopensim-SC-3cb2b3b2d1904523f5981ef775e18dc25f733433.zip
opensim-SC-3cb2b3b2d1904523f5981ef775e18dc25f733433.tar.gz
opensim-SC-3cb2b3b2d1904523f5981ef775e18dc25f733433.tar.bz2
opensim-SC-3cb2b3b2d1904523f5981ef775e18dc25f733433.tar.xz
Merge branch 'master' of opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs')
-rw-r--r--OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs45
1 files changed, 19 insertions, 26 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
index 757f06c..6322695 100644
--- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
@@ -449,6 +449,7 @@ public sealed class BSCharacter : BSPhysObject
449 public override OMV.Vector3 GeometricCenter { get { return OMV.Vector3.Zero; } } 449 public override OMV.Vector3 GeometricCenter { get { return OMV.Vector3.Zero; } }
450 public override OMV.Vector3 CenterOfMass { get { return OMV.Vector3.Zero; } } 450 public override OMV.Vector3 CenterOfMass { get { return OMV.Vector3.Zero; } }
451 451
452 // PhysicsActor.TargetVelocity
452 // Sets the target in the motor. This starts the changing of the avatar's velocity. 453 // Sets the target in the motor. This starts the changing of the avatar's velocity.
453 public override OMV.Vector3 TargetVelocity 454 public override OMV.Vector3 TargetVelocity
454 { 455 {
@@ -459,7 +460,7 @@ public sealed class BSCharacter : BSPhysObject
459 set 460 set
460 { 461 {
461 DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value); 462 DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value);
462 m_targetVelocity = value; 463 base.m_targetVelocity = value;
463 OMV.Vector3 targetVel = value; 464 OMV.Vector3 targetVel = value;
464 if (_setAlwaysRun && !_flying) 465 if (_setAlwaysRun && !_flying)
465 targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); 466 targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f);
@@ -472,46 +473,38 @@ public sealed class BSCharacter : BSPhysObject
472 public override OMV.Vector3 Velocity { 473 public override OMV.Vector3 Velocity {
473 get { return RawVelocity; } 474 get { return RawVelocity; }
474 set { 475 set {
475 RawVelocity = value; 476 if (m_moveActor != null)
476 OMV.Vector3 vel = RawVelocity;
477
478 DetailLog("{0}: set Velocity = {1}", LocalID, value);
479
480 PhysScene.TaintedObject(LocalID, "BSCharacter.setVelocity", delegate()
481 { 477 {
482 if (m_moveActor != null) 478 // m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */);
483 m_moveActor.SetVelocityAndTarget(vel, vel, true /* inTaintTime */); 479 m_moveActor.SetVelocityAndTarget(RawVelocity, RawVelocity, false /* inTaintTime */);
480 }
481 base.Velocity = value;
482 }
483 }
484 484
485 DetailLog("{0},BSCharacter.setVelocity,taint,vel={1}", LocalID, vel); 485 // SetMomentum just sets the velocity without a target. We need to stop the movement actor if a character.
486 ForceVelocity = vel; 486 public override void SetMomentum(OMV.Vector3 momentum)
487 }); 487 {
488 if (m_moveActor != null)
489 {
490 // m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */);
491 m_moveActor.SetVelocityAndTarget(RawVelocity, RawVelocity, false /* inTaintTime */);
488 } 492 }
493 base.SetMomentum(momentum);
489 } 494 }
490 495
491 public override OMV.Vector3 ForceVelocity { 496 public override OMV.Vector3 ForceVelocity {
492 get { return RawVelocity; } 497 get { return RawVelocity; }
493 set { 498 set {
494 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity"); 499 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity");
495// Util.PrintCallStack(); 500 DetailLog("{0}: BSCharacter.ForceVelocity.set = {1}", LocalID, value);
496 DetailLog("{0}: set ForceVelocity = {1}", LocalID, value);
497 501
498 RawVelocity = value; 502 RawVelocity = Util.ClampV(value, BSParam.MaxLinearVelocity);
499 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity); 503 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity);
500 PhysScene.PE.Activate(PhysBody, true); 504 PhysScene.PE.Activate(PhysBody, true);
501 } 505 }
502 } 506 }
503 507
504 // SetMomentum just sets the velocity without a target. We need to stop the movement actor if a character.
505 public override void SetMomentum(OMV.Vector3 momentum)
506 {
507 if (m_moveActor != null)
508 {
509 m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */);
510 }
511 base.SetMomentum(momentum);
512 }
513
514
515 public override OMV.Vector3 Torque { 508 public override OMV.Vector3 Torque {
516 get { return RawTorque; } 509 get { return RawTorque; }
517 set { RawTorque = value; 510 set { RawTorque = value;