From 776e83941aacf771bb28d1ff5dc157cbd91fc44a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 27 Dec 2007 23:19:00 +0000 Subject: [PATCH] * Fixed Physical prim, various issues, viewer freezes, sim crashes, ODE errors, etc. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f2c9b57347..2193d07297 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -299,29 +299,42 @@ namespace OpenSim.Region.Physics.OdePlugin p2.PhysicsActorType == (int) ActorTypes.Prim)) { if (p2.PhysicsActorType == (int) ActorTypes.Agent) - { + { if (p1.IsPhysical) + { + int q = 1; + } p2.CollidingObj = true; //contacts[i].depth = 0.003f; 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)); + } else { + if (p1.IsPhysical) + { + int q = 1; + } contacts[i].depth = 0.0000000f; } if (p1.PhysicsActorType == (int) ActorTypes.Agent) { + if (p2.IsPhysical) + { + int q = 1; + } p1.CollidingObj = true; //contacts[i].depth = 0.003f; 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; + OdeCharacter character = (OdeCharacter)p1; character.SetPidStatus(true); } else { + //contacts[i].depth = 0.0000000f; } } @@ -329,7 +342,7 @@ 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 = -1f; + contacts[i].depth = 0f; } if (contacts[i].depth >= 1.00f) { @@ -356,11 +369,11 @@ namespace OpenSim.Region.Physics.OdePlugin } if (p1.PhysicsActorType == (int) ActorTypes.Agent) { - OdeCharacter character = (OdeCharacter) p2; + OdeCharacter character = (OdeCharacter)p1; //p2.CollidingObj = true; contacts[i].depth = 0.003f; - p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f); + p1.Velocity = p1.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), @@ -1208,4 +1221,4 @@ namespace OpenSim.Region.Physics.OdePlugin { } } -} \ No newline at end of file +}