diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1f00fbbeb7..a440ed4857 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1093,13 +1093,11 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Sets avatar height in the physics plugin
///
+ /// New height of avatar
public void SetHeight(float height)
{
if (PhysicsActor != null && !IsChildAgent)
- {
- Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
- PhysicsActor.Size = SetSize;
- }
+ PhysicsActor.Size = new Vector3(0.45f, 0.6f, height);
}
///
@@ -3311,14 +3309,11 @@ namespace OpenSim.Region.Framework.Scenes
m_physicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec,
new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying);
- scene.AddPhysicsActorTaint(m_physicsActor);
- //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
- m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
- m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
- m_physicsActor.SubscribeEvents(500);
- m_physicsActor.LocalID = LocalId;
-
- SetHeight(m_appearance.AvatarHeight);
+ //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
+ PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
+ PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
+ PhysicsActor.SubscribeEvents(500);
+ PhysicsActor.LocalID = LocalId;
}
private void OutOfBoundsCall(Vector3 pos)
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
index 5e2eeebc44..1e1d5e3856 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
@@ -44,8 +44,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
private bool flying;
private bool iscolliding;
- public BasicActor()
+ public BasicActor(Vector3 size)
{
+ Size = size;
}
public override int PhysicsActorType
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index 1ceed1a91d..2e1421649f 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
}
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
{
- BasicActor act = new BasicActor();
+ BasicActor act = new BasicActor(size);
act.Position = position;
act.Flying = isFlying;
_actors.Add(act);
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 43a93c5586..73ad26651f 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -200,9 +200,11 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_colliderarr[i] = false;
}
- CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
- //m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH.ToString());
- m_tainted_CAPSULE_LENGTH = CAPSULE_LENGTH;
+
+ // We can set taint and actual to be the same here, since the entire character will be set up when the
+ // m_tainted_isPhysical is processed.
+ SetTaintedCapsuleLength(size);
+ CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH;
m_isPhysical = false; // current status: no ODE information exists
m_tainted_isPhysical = true; // new tainted status: need to create ODE information
@@ -463,24 +465,28 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); }
set
{
- if (value.IsFinite())
- {
- m_pidControllerActive = true;
-
- Vector3 SetSize = value;
- m_tainted_CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
-// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
+ SetTaintedCapsuleLength(value);
// If we reset velocity here, then an avatar stalls when it crosses a border for the first time
// (as the height of the new root agent is set).
// Velocity = Vector3.Zero;
- _parent_scene.AddPhysicsActorTaint(this);
- }
- else
- {
- m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size from Scene on {0}", Name);
- }
+ _parent_scene.AddPhysicsActorTaint(this);
+ }
+ }
+
+ private void SetTaintedCapsuleLength(Vector3 size)
+ {
+ if (size.IsFinite())
+ {
+ m_pidControllerActive = true;
+
+ m_tainted_CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
+// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
+ }
+ else
+ {
+ m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.Name);
}
}