aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 9c3f160..cfcccac 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -75,9 +75,10 @@ public sealed class BSCharacter : BSPhysObject
75 // Avatars are always complete (in the physics engine sense) 75 // Avatars are always complete (in the physics engine sense)
76 public override bool IsIncomplete { get { return false; } } 76 public override bool IsIncomplete { get { return false; } }
77 77
78 // 'activate' is called with this character after all initialization is complete
78 public BSCharacter( 79 public BSCharacter(
79 uint localID, String avName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 vel, OMV.Vector3 size, bool isFlying) 80 uint localID, String avName, BSScene parent_scene,
80 81 OMV.Vector3 pos, OMV.Vector3 vel, OMV.Vector3 size, bool isFlying, Action<BSCharacter> activate)
81 : base(parent_scene, localID, avName, "BSCharacter") 82 : base(parent_scene, localID, avName, "BSCharacter")
82 { 83 {
83 _physicsActorType = (int)ActorTypes.Agent; 84 _physicsActorType = (int)ActorTypes.Agent;
@@ -124,6 +125,9 @@ public sealed class BSCharacter : BSPhysObject
124 SetPhysicalProperties(); 125 SetPhysicalProperties();
125 126
126 IsInitialized = true; 127 IsInitialized = true;
128
129 if (activate != null)
130 activate(this);
127 }); 131 });
128 return; 132 return;
129 } 133 }
@@ -472,12 +476,13 @@ public sealed class BSCharacter : BSPhysObject
472 } 476 }
473 } 477 }
474 478
479 // Force the setting of velocity. Called at taint time.
480 // Exists so that setting force by anyone can be overridden by a subcless.
475 public override OMV.Vector3 ForceVelocity { 481 public override OMV.Vector3 ForceVelocity {
476 get { return RawVelocity; } 482 get { return RawVelocity; }
477 set { 483 set {
478 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity"); 484 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity");
479// Util.PrintCallStack(); 485 DetailLog("{0},BSCharacter.setForceVelocity,call,vel={1}", LocalID, value);
480 DetailLog("{0}: set ForceVelocity = {1}", LocalID, value);
481 486
482 RawVelocity = value; 487 RawVelocity = value;
483 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity); 488 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity);