From f852b6455550569d002d0b1c527249f3f7894326 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 26 Dec 2007 17:16:47 +0000 Subject: * 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. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 50 ++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') 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 TerrainContact.surface.soft_erp = 0.1025f; AvatarMovementprimContact.surface.mu = 150.0f; - AvatarMovementprimContact.surface.bounce = 0.2f; + AvatarMovementprimContact.surface.bounce = 0.1f; AvatarMovementTerrainContact.surface.mode |= d.ContactFlags.SoftERP; AvatarMovementTerrainContact.surface.mu = 150.0f; @@ -297,7 +297,9 @@ namespace OpenSim.Region.Physics.OdePlugin { p2.CollidingObj = true; //contacts[i].depth = 0.003f; - //p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); + p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); + OdeCharacter character = (OdeCharacter)p2; + character.SetPidStatus(true); //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)); } @@ -309,8 +311,10 @@ namespace OpenSim.Region.Physics.OdePlugin { p1.CollidingObj = true; //contacts[i].depth = 0.003f; - //p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); + p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); //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)); + OdeCharacter character = (OdeCharacter)p2; + character.SetPidStatus(true); } else { @@ -321,12 +325,48 @@ namespace OpenSim.Region.Physics.OdePlugin if (p1.PhysicsActorType == (int)ActorTypes.Prim && p2.PhysicsActorType == (int)ActorTypes.Prim) { // Don't collide, one or both prim will explode. - contacts[i].depth = 0.0f; + contacts[i].depth = -1f; + } + if (contacts[i].depth >= 1.00f) + { + if ((p2.PhysicsActorType == (int)ActorTypes.Agent && p1.PhysicsActorType == (int)ActorTypes.Unknown) || (p1.PhysicsActorType == (int)ActorTypes.Agent && p2.PhysicsActorType == (int)ActorTypes.Unknown)) + { + + if (p2.PhysicsActorType == (int)ActorTypes.Agent) + { + OdeCharacter character = (OdeCharacter)p2; + + //p2.CollidingObj = true; + contacts[i].depth = 0.003f; + p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f); + 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)); + character.SetPidStatus(true); + + } + else + { + + } + if (p1.PhysicsActorType == (int)ActorTypes.Agent) + { + OdeCharacter character = (OdeCharacter)p2; + + //p2.CollidingObj = true; + contacts[i].depth = 0.003f; + p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f); + 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)); + character.SetPidStatus(true); + } + else + { + //contacts[i].depth = 0.0000000f; + } + } } } #endregion - if (contacts[i].depth > 0f) + if (contacts[i].depth >= 0f) { if (name1 == "Terrain" || name2 == "Terrain") { -- cgit v1.1