aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
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 /OpenSim/Region/Physics
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-c0ba99e5ada0b734b932091befce69dbd53d149a.zip
opensim-SC-c0ba99e5ada0b734b932091befce69dbd53d149a.tar.gz
opensim-SC-c0ba99e5ada0b734b932091befce69dbd53d149a.tar.bz2
opensim-SC-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
Diffstat (limited to 'OpenSim/Region/Physics')
-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
3 files changed, 25 insertions, 18 deletions
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