diff options
author | Teravus Ovares | 2007-12-26 17:16:47 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-26 17:16:47 +0000 |
commit | f852b6455550569d002d0b1c527249f3f7894326 (patch) | |
tree | 95abccc4ae8529dc8c1b2aa283ac44e952f7dda7 /OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |
parent | * Patch by Melanie to fix CreateSelected (diff) | |
download | opensim-SC-f852b6455550569d002d0b1c527249f3f7894326.zip opensim-SC-f852b6455550569d002d0b1c527249f3f7894326.tar.gz opensim-SC-f852b6455550569d002d0b1c527249f3f7894326.tar.bz2 opensim-SC-f852b6455550569d002d0b1c527249f3f7894326.tar.xz |
* This update includes a wide range of changes to the ODEPlugin for avatar movement, including:
** - avatar can navigate stairs better now
** - avatar can land without shooting into the air
** - excessive collisions with the ground are tempered somewhat and should only shoot the avatar up 20m instead of 200m
** - Try Catched a TextureDownloadModule.cs array out of bounds error with a report that causes it not to crash the sim, however it reports a few important items for tracking it down.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 51c0e15..8bb822e 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
136 | TerrainContact.surface.soft_erp = 0.1025f; | 136 | TerrainContact.surface.soft_erp = 0.1025f; |
137 | 137 | ||
138 | AvatarMovementprimContact.surface.mu = 150.0f; | 138 | AvatarMovementprimContact.surface.mu = 150.0f; |
139 | AvatarMovementprimContact.surface.bounce = 0.2f; | 139 | AvatarMovementprimContact.surface.bounce = 0.1f; |
140 | 140 | ||
141 | AvatarMovementTerrainContact.surface.mode |= d.ContactFlags.SoftERP; | 141 | AvatarMovementTerrainContact.surface.mode |= d.ContactFlags.SoftERP; |
142 | AvatarMovementTerrainContact.surface.mu = 150.0f; | 142 | AvatarMovementTerrainContact.surface.mu = 150.0f; |
@@ -297,7 +297,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
297 | { | 297 | { |
298 | p2.CollidingObj = true; | 298 | p2.CollidingObj = true; |
299 | //contacts[i].depth = 0.003f; | 299 | //contacts[i].depth = 0.003f; |
300 | //p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); | 300 | p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); |
301 | OdeCharacter character = (OdeCharacter)p2; | ||
302 | character.SetPidStatus(true); | ||
301 | //contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2)); | 303 | //contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2)); |
302 | 304 | ||
303 | } | 305 | } |
@@ -309,8 +311,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
309 | { | 311 | { |
310 | p1.CollidingObj = true; | 312 | p1.CollidingObj = true; |
311 | //contacts[i].depth = 0.003f; | 313 | //contacts[i].depth = 0.003f; |
312 | //p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); | 314 | p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); |
313 | //contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p2.Size.X / 2), contacts[i].pos.Y + (p2.Size.Y / 2), contacts[i].pos.Z + (p2.Size.Z / 2)); | 315 | //contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p2.Size.X / 2), contacts[i].pos.Y + (p2.Size.Y / 2), contacts[i].pos.Z + (p2.Size.Z / 2)); |
316 | OdeCharacter character = (OdeCharacter)p2; | ||
317 | character.SetPidStatus(true); | ||
314 | } | 318 | } |
315 | else | 319 | else |
316 | { | 320 | { |
@@ -321,12 +325,48 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
321 | if (p1.PhysicsActorType == (int)ActorTypes.Prim && p2.PhysicsActorType == (int)ActorTypes.Prim) | 325 | if (p1.PhysicsActorType == (int)ActorTypes.Prim && p2.PhysicsActorType == (int)ActorTypes.Prim) |
322 | { | 326 | { |
323 | // Don't collide, one or both prim will explode. | 327 | // Don't collide, one or both prim will explode. |
324 | contacts[i].depth = 0.0f; | 328 | contacts[i].depth = -1f; |
329 | } | ||
330 | if (contacts[i].depth >= 1.00f) | ||
331 | { | ||
332 | if ((p2.PhysicsActorType == (int)ActorTypes.Agent && p1.PhysicsActorType == (int)ActorTypes.Unknown) || (p1.PhysicsActorType == (int)ActorTypes.Agent && p2.PhysicsActorType == (int)ActorTypes.Unknown)) | ||
333 | { | ||
334 | |||
335 | if (p2.PhysicsActorType == (int)ActorTypes.Agent) | ||
336 | { | ||
337 | OdeCharacter character = (OdeCharacter)p2; | ||
338 | |||
339 | //p2.CollidingObj = true; | ||
340 | contacts[i].depth = 0.003f; | ||
341 | p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f); | ||
342 | contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2)); | ||
343 | character.SetPidStatus(true); | ||
344 | |||
345 | } | ||
346 | else | ||
347 | { | ||
348 | |||
349 | } | ||
350 | if (p1.PhysicsActorType == (int)ActorTypes.Agent) | ||
351 | { | ||
352 | OdeCharacter character = (OdeCharacter)p2; | ||
353 | |||
354 | //p2.CollidingObj = true; | ||
355 | contacts[i].depth = 0.003f; | ||
356 | p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f); | ||
357 | contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2)); | ||
358 | character.SetPidStatus(true); | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | //contacts[i].depth = 0.0000000f; | ||
363 | } | ||
364 | } | ||
325 | } | 365 | } |
326 | } | 366 | } |
327 | #endregion | 367 | #endregion |
328 | 368 | ||
329 | if (contacts[i].depth > 0f) | 369 | if (contacts[i].depth >= 0f) |
330 | { | 370 | { |
331 | if (name1 == "Terrain" || name2 == "Terrain") | 371 | if (name1 == "Terrain" || name2 == "Terrain") |
332 | { | 372 | { |