Falling animation fix, comment out instrumentation.

This commit is contained in:
Kitto Flora
2010-09-06 21:45:07 +00:00
parent 24c73aa8b2
commit c719e016ed
4 changed files with 90 additions and 50 deletions

View File

@@ -269,7 +269,10 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
public override bool IsColliding
{
get { return m_iscolliding; }
//#@ get { return m_iscolliding; }
get { //##
//Console.WriteLine(">>>>>>>>>>>> IC get = {0}", m_iscolliding); //##
return m_iscolliding; } //##
set
{
int i;
@@ -307,6 +310,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_iscolliding = true;
}
// ## Console.WriteLine("IC SET = {0} t{1} f{2} i {3}", value, truecount, falsecount, m_iscolliding);
if (m_wascolliding != m_iscolliding)
{
//base.SendCollisionUpdate(new CollisionEventUpdate());
@@ -589,7 +593,7 @@ namespace OpenSim.Region.Physics.OdePlugin
Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
_parent_scene.geom_name_map[Shell] = m_name;
_parent_scene.actor_name_map[Shell] = (PhysicsActor)this;
//Console.WriteLine("**** Create {2} Dicts: actor={0} name={1}", _parent_scene.actor_name_map.Count, _parent_scene.geom_name_map.Count, m_name);
Console.WriteLine("**** Create {2} Dicts: actor={0} name={1} height={3} rad={4}", _parent_scene.actor_name_map.Count, _parent_scene.geom_name_map.Count, m_name, CAPSULE_LENGTH, CAPSULE_RADIUS);
d.GeomSetCategoryBits(Shell, (int)m_collisionCategories);
d.GeomSetCollideBits(Shell, (int)m_collisionFlags);
@@ -857,7 +861,9 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_pidControllerActive = false;
force *= 100f;
doForce(force);
//Console.WriteLine("DF 1"); // ##
if (!force.ApproxEquals(Vector3.Zero, 0.01f))
doForce(force);
// If uncommented, things get pushed off world
//
// m_log.Debug("Push!");
@@ -896,7 +902,8 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodyAddForce(Body, force.X, force.Y, force.Z);
//d.BodySetRotation(Body, ref m_StandUpRotation);
//standupStraight();
d.Vector3 vel = d.BodyGetLinearVel(Body); //##
//Console.WriteLine("AvVel <{0},{1},{2}>", vel.X, vel.Y, vel.Z); //##
}
}
@@ -1103,12 +1110,14 @@ namespace OpenSim.Region.Physics.OdePlugin
}
if (vec.IsFinite())
{
if (!vec.ApproxEquals(Vector3.Zero, 0.01f))
if (!vec.ApproxEquals(Vector3.Zero, 0.02f)) // 0.01 allows 0.002 !!
{
//Console.WriteLine("DF 2"); // ##
doForce(vec);
if (!_zeroFlag)
{
AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
// AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
}
}
}

View File

@@ -713,7 +713,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// Test if we're colliding a geom with a space.
// If so we have to drill down into the space recursively
//Console.WriteLine("near -----------"); //##
if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
{
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
@@ -844,11 +844,21 @@ namespace OpenSim.Region.Physics.OdePlugin
// Testing if the collision is at the feet of the avatar
//m_log.DebugFormat("[PHYSICS]: {0} - {1} - {2} - {3}", curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f));
if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f))
p2.IsColliding = true;
}
//#@ if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f))
//#@ p2.IsColliding = true;
if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f)){ //##
//Console.WriteLine("AvColl 1 {0} - {1} - {2} - {3}", //##
// curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f)); //##
p2.IsColliding = true; //##
}else{
//Console.WriteLine("AvColl 2 {0} - {1} - {2} - {3}", //##
// curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f)); //##
} //##
}
else
{
//Console.WriteLine("AvColl 3 {0}", p2.PhysicsActorType); //##
p2.IsColliding = true;
}