Fix wrong active angularlock detection (it was only burning cpu), stop trying to add a amotor to each child prim and stop using unnecessary trimeshcallbacks

avinationmerge
UbitUmarov 2015-10-17 21:56:15 +01:00
parent 8dcb4de53c
commit 24435cfe9a
2 changed files with 11 additions and 16 deletions

View File

@ -445,7 +445,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
m_disabled = false;
// The body doesn't already have a finite rotation mode set here
if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0.0f)) && _parent == null)
if ((!m_angularlock.ApproxEquals(Vector3.One, 0.0f)) && _parent == null)
{
createAMotor(m_angularlock);
}
@ -919,7 +919,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
try
{
SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null));
SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null));
}
catch (AccessViolationException)
{
@ -1121,7 +1121,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
{
d.Mass m2;
d.MassSetZero(out m2);
d.MassSetBoxTotal(out m2, prim.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z);
d.MassSetBoxTotal(out m2, prm.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z);
d.Quaternion quat = new d.Quaternion();
quat.W = prm._orientation.W;
@ -1184,11 +1184,6 @@ Console.WriteLine("ZProcessTaints for " + Name);
prm.m_collisionscore = 0;
prm.m_disabled = false;
// The body doesn't already have a finite rotation mode set here
if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0f)) && _parent == null)
{
prm.createAMotor(m_angularlock);
}
prm.Body = Body;
_parent_scene.ActivatePrim(prm);
}
@ -1235,7 +1230,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
m_disabled = false;
// The body doesn't already have a finite rotation mode set here
if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0f)) && _parent == null)
if ((!m_angularlock.ApproxEquals(Vector3.One, 0f)) && _parent == null)
{
createAMotor(m_angularlock);
}

View File

@ -580,8 +580,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
m_suportCombine = false;
nearCallback = near;
triCallback = TriCallback;
triArrayCallback = TriArrayCallback;
// triCallback = TriCallback;
// triArrayCallback = TriArrayCallback;
m_rayCastManager = new ODERayCastRequestManager(this);
// Create the world and the first space
@ -1811,10 +1811,10 @@ namespace OpenSim.Region.PhysicsModule.ODE
//}
// }
}
/*
private int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount)
{
/* String name1 = null;
String name1 = null;
String name2 = null;
if (!geom_name_map.TryGetValue(trimesh, out name1))
@ -1827,7 +1827,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
}
m_log.InfoFormat("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
*/
return 1;
}
@ -1857,7 +1857,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
return 1;
}
*/
/// <summary>
/// This is our collision testing routine in ODE
/// </summary>
@ -1988,8 +1988,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
x = x - offsetX + 1f;
y = y - offsetY + 1f;
// map is rotated
// map is rotated
index = (int)x * ((int)m_regionHeight + 3) + (int)y;
if (index < TerrainHeightFieldHeights[heightFieldGeom].Length)