try to let avas climb higher steps. Will only work in some cases, may have bad effects, so needs some more testing

avinationmerge
UbitUmarov 2012-05-21 12:35:17 +01:00
parent 32e63fc04f
commit 85f5789993
2 changed files with 75 additions and 9 deletions

View File

@ -2562,10 +2562,10 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
d.Quaternion qtmp; d.Quaternion qtmp;
d.GeomCopyQuaternion(prim_geom, out qtmp); d.GeomCopyQuaternion(prim_geom, out qtmp);
_orientation.W = qtmp.W;
_orientation.X = qtmp.X; _orientation.X = qtmp.X;
_orientation.Y = qtmp.Y; _orientation.Y = qtmp.Y;
_orientation.Z = qtmp.Z; _orientation.Z = qtmp.Z;
_orientation.W = qtmp.W;
d.Vector3 lpos = d.GeomGetPosition(prim_geom); d.Vector3 lpos = d.GeomGetPosition(prim_geom);
_position.X = lpos.X; _position.X = lpos.X;

View File

@ -1005,19 +1005,85 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
else else
{
if (AvanormOverride)
{
if (curContact.depth > 0.3f)
{ {
if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f) if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f)
p1.IsColliding = true; p1.IsColliding = true;
if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f) if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f)
p2.IsColliding = true; p2.IsColliding = true;
if (AvanormOverride && curContact.depth > 0.3f)
{
curContact.normal.X = normoverride.X; curContact.normal.X = normoverride.X;
curContact.normal.Y = normoverride.Y; curContact.normal.Y = normoverride.Y;
curContact.normal.Z = normoverride.Z; curContact.normal.Z = normoverride.Z;
} }
else
{
if (dop1foot)
{
float sz = p1.Size.Z;
Vector3 vtmp = p1.Position;
float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
if (ppos > 0f)
{
if (!p1.Flying)
{
d.AABB aabb;
d.GeomGetAABB(g2, out aabb);
float tmp = vtmp.Z - sz * .25f;
if (aabb.MaxZ < tmp)
{
vtmp.X = curContact.pos.X - vtmp.X;
vtmp.Y = curContact.pos.Y - vtmp.Y;
vtmp.Z = -0.2f;
vtmp.Normalize();
curContact.normal.X = vtmp.X;
curContact.normal.Y = vtmp.Y;
curContact.normal.Z = vtmp.Z;
}
}
}
else
p1.IsColliding = true;
}
if (dop2foot)
{
float sz = p2.Size.Z;
Vector3 vtmp = p2.Position;
float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
if (ppos > 0f)
{
if (!p2.Flying)
{
d.AABB aabb;
d.GeomGetAABB(g1, out aabb);
float tmp = vtmp.Z - sz * .25f;
if (aabb.MaxZ < tmp)
{
vtmp.X = curContact.pos.X - vtmp.X;
vtmp.Y = curContact.pos.Y - vtmp.Y;
vtmp.Z = -0.2f;
vtmp.Normalize();
curContact.normal.X = vtmp.X;
curContact.normal.Y = vtmp.Y;
curContact.normal.Z = vtmp.Z;
}
}
}
else
p2.IsColliding = true;
}
}
}
Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
d.JointAttach(Joint, b1, b2); d.JointAttach(Joint, b1, b2);