aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-15 22:29:36 +0000
committerJustin Clark-Casey (justincc)2011-12-15 22:29:36 +0000
commitc0ba99e5ada0b734b932091befce69dbd53d149a (patch)
treeaf614f3e2bcd1b9697e488f8c329e93a3c28a166
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-c0ba99e5ada0b734b932091befce69dbd53d149a.zip
opensim-SC_OLD-c0ba99e5ada0b734b932091befce69dbd53d149a.tar.gz
opensim-SC_OLD-c0ba99e5ada0b734b932091befce69dbd53d149a.tar.bz2
opensim-SC_OLD-c0ba99e5ada0b734b932091befce69dbd53d149a.tar.xz
Stop having to call SetHeight again in ScenePresence.AddToPhysicalScene() when we've already passed size information to the avatar at PhysicsScene.AddAvatar()
Eliminate some copypasta for height setting in OdeCharacter
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs3
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs38
4 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6f5b6fe..ac58dae 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1149,13 +1149,11 @@ namespace OpenSim.Region.Framework.Scenes
1149 /// <summary> 1149 /// <summary>
1150 /// Sets avatar height in the physics plugin 1150 /// Sets avatar height in the physics plugin
1151 /// </summary> 1151 /// </summary>
1152 /// <param name="height">New height of avatar</param>
1152 public void SetHeight(float height) 1153 public void SetHeight(float height)
1153 { 1154 {
1154 if (PhysicsActor != null && !IsChildAgent) 1155 if (PhysicsActor != null && !IsChildAgent)
1155 { 1156 PhysicsActor.Size = new Vector3(0.45f, 0.6f, height);
1156 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1157 PhysicsActor.Size = SetSize;
1158 }
1159 } 1157 }
1160 1158
1161 /// <summary> 1159 /// <summary>
@@ -3273,8 +3271,6 @@ namespace OpenSim.Region.Framework.Scenes
3273 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong 3271 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
3274 PhysicsActor.SubscribeEvents(500); 3272 PhysicsActor.SubscribeEvents(500);
3275 PhysicsActor.LocalID = LocalId; 3273 PhysicsActor.LocalID = LocalId;
3276
3277 SetHeight(Appearance.AvatarHeight);
3278 } 3274 }
3279 3275
3280 private void OutOfBoundsCall(Vector3 pos) 3276 private void OutOfBoundsCall(Vector3 pos)
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
index 5e2eeeb..1e1d5e3 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
@@ -44,8 +44,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
44 private bool flying; 44 private bool flying;
45 private bool iscolliding; 45 private bool iscolliding;
46 46
47 public BasicActor() 47 public BasicActor(Vector3 size)
48 { 48 {
49 Size = size;
49 } 50 }
50 51
51 public override int PhysicsActorType 52 public override int PhysicsActorType
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index 1ceed1a..2e14216 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
56 } 56 }
57 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) 57 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
58 { 58 {
59 BasicActor act = new BasicActor(); 59 BasicActor act = new BasicActor(size);
60 act.Position = position; 60 act.Position = position;
61 act.Flying = isFlying; 61 act.Flying = isFlying;
62 _actors.Add(act); 62 _actors.Add(act);
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 9c7e0ef..9200016 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -199,9 +199,11 @@ namespace OpenSim.Region.Physics.OdePlugin
199 { 199 {
200 m_colliderarr[i] = false; 200 m_colliderarr[i] = false;
201 } 201 }
202 CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; 202
203 //m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH.ToString()); 203 // We can set taint and actual to be the same here, since the entire character will be set up when the
204 m_tainted_CAPSULE_LENGTH = CAPSULE_LENGTH; 204 // m_tainted_isPhysical is processed.
205 SetTaintedCapsuleLength(size);
206 CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH;
205 207
206 m_isPhysical = false; // current status: no ODE information exists 208 m_isPhysical = false; // current status: no ODE information exists
207 m_tainted_isPhysical = true; // new tainted status: need to create ODE information 209 m_tainted_isPhysical = true; // new tainted status: need to create ODE information
@@ -457,24 +459,28 @@ namespace OpenSim.Region.Physics.OdePlugin
457 get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); } 459 get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); }
458 set 460 set
459 { 461 {
460 if (value.IsFinite()) 462 SetTaintedCapsuleLength(value);
461 {
462 m_pidControllerActive = true;
463
464 Vector3 SetSize = value;
465 m_tainted_CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
466// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
467 463
468 // If we reset velocity here, then an avatar stalls when it crosses a border for the first time 464 // If we reset velocity here, then an avatar stalls when it crosses a border for the first time
469 // (as the height of the new root agent is set). 465 // (as the height of the new root agent is set).
470// Velocity = Vector3.Zero; 466// Velocity = Vector3.Zero;
471 467
472 _parent_scene.AddPhysicsActorTaint(this); 468 _parent_scene.AddPhysicsActorTaint(this);
473 } 469 }
474 else 470 }
475 { 471
476 m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size from Scene on {0}", Name); 472 private void SetTaintedCapsuleLength(Vector3 size)
477 } 473 {
474 if (size.IsFinite())
475 {
476 m_pidControllerActive = true;
477
478 m_tainted_CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
479// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
480 }
481 else
482 {
483 m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.Name);
478 } 484 }
479 } 485 }
480 486