aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-11-29 00:12:11 +0000
committerJustin Clark-Casey (justincc)2014-11-29 00:12:11 +0000
commit265fe349e00b3ece59ec02e56f83bb7623e9d962 (patch)
tree42afe816271f54a017fe5f731d905e923ef5d67b /OpenSim/Region/Physics/OdePlugin
parentAvoid repeated lag-generating continuous attempts to retrieve HG service Urls... (diff)
downloadopensim-SC_OLD-265fe349e00b3ece59ec02e56f83bb7623e9d962.zip
opensim-SC_OLD-265fe349e00b3ece59ec02e56f83bb7623e9d962.tar.gz
opensim-SC_OLD-265fe349e00b3ece59ec02e56f83bb7623e9d962.tar.bz2
opensim-SC_OLD-265fe349e00b3ece59ec02e56f83bb7623e9d962.tar.xz
Somewhat improve avatar region crossings by properly preserving velocity when avatar enters the new region.
This commit addresses the following issues were causing velocity to be set to 0 on the new region, disrupting flight in particular * Full avatar updates contained no velocity information, which does appear to have some effect in testing. * BulletSim was always setting the velocity to 0 for the new BSCharacter. Now, physics engines take a velocity parameter when setting up characters so we can avoid this. This patch applies to both Bullet and ODE.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs6
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs11
2 files changed, 8 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 67503df..05eaf2a 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -167,6 +167,7 @@ namespace OpenSim.Region.Physics.OdePlugin
167 /// <param name="avName"></param> 167 /// <param name="avName"></param>
168 /// <param name="parent_scene"></param> 168 /// <param name="parent_scene"></param>
169 /// <param name="pos"></param> 169 /// <param name="pos"></param>
170 /// <param name="vel"></param>
170 /// <param name="size"></param> 171 /// <param name="size"></param>
171 /// <param name="pid_d"></param> 172 /// <param name="pid_d"></param>
172 /// <param name="pid_p"></param> 173 /// <param name="pid_p"></param>
@@ -178,7 +179,7 @@ namespace OpenSim.Region.Physics.OdePlugin
178 /// <param name="walk_divisor"></param> 179 /// <param name="walk_divisor"></param>
179 /// <param name="rundivisor"></param> 180 /// <param name="rundivisor"></param>
180 public OdeCharacter( 181 public OdeCharacter(
181 String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, 182 String avName, OdeScene parent_scene, Vector3 pos, Vector3 vel, Vector3 size, float pid_d, float pid_p,
182 float capsule_radius, float tensor, float density, 183 float capsule_radius, float tensor, float density,
183 float walk_divisor, float rundivisor) 184 float walk_divisor, float rundivisor)
184 { 185 {
@@ -210,6 +211,9 @@ namespace OpenSim.Region.Physics.OdePlugin
210 m_log.WarnFormat("[ODE CHARACTER]: Got NaN Position on Character Create for {0}", avName); 211 m_log.WarnFormat("[ODE CHARACTER]: Got NaN Position on Character Create for {0}", avName);
211 } 212 }
212 213
214 _velocity = vel;
215 m_taintTargetVelocity = vel;
216
213 _parent_scene = parent_scene; 217 _parent_scene = parent_scene;
214 218
215 PID_D = pid_d; 219 PID_D = pid_d;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 6d7f079..5953557 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -1969,16 +1969,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1969 1969
1970 #region Add/Remove Entities 1970 #region Add/Remove Entities
1971 1971
1972 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) 1972 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying)
1973 { 1973 {
1974 Vector3 pos;
1975 pos.X = position.X;
1976 pos.Y = position.Y;
1977 pos.Z = position.Z;
1978
1979 OdeCharacter newAv 1974 OdeCharacter newAv
1980 = new OdeCharacter( 1975 = new OdeCharacter(
1981 avName, this, pos, size, avPIDD, avPIDP, 1976 avName, this, position, velocity, size, avPIDD, avPIDP,
1982 avCapRadius, avStandupTensor, avDensity, 1977 avCapRadius, avStandupTensor, avDensity,
1983 avMovementDivisorWalk, avMovementDivisorRun); 1978 avMovementDivisorWalk, avMovementDivisorRun);
1984 1979