[UNTESTED] core Ode: let broken mesh physical prims collide with land as

the defaul basic box so they don't go off world.
connector_plugin
UbitUmarov 2012-10-19 01:25:30 +01:00 committed by Melanie
parent 38e96afa38
commit 28483150e2
1 changed files with 11 additions and 6 deletions

View File

@ -344,7 +344,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_assetFailed) if (m_assetFailed)
{ {
d.GeomSetCategoryBits(prim_geom, 0); d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0); d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
} }
else else
{ {
@ -418,7 +418,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_assetFailed) if (m_assetFailed)
{ {
d.GeomSetCategoryBits(prim_geom, 0); d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0); d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
} }
else else
{ {
@ -851,6 +851,11 @@ namespace OpenSim.Region.Physics.OdePlugin
private static Dictionary<IMesh, IntPtr> m_MeshToTriMeshMap = new Dictionary<IMesh, IntPtr>(); private static Dictionary<IMesh, IntPtr> m_MeshToTriMeshMap = new Dictionary<IMesh, IntPtr>();
public int BadAssetColideBits()
{
return (m_isphysical ? (int)CollisionCategories.Land : 0);
}
private void setMesh(OdeScene parent_scene, IMesh mesh) private void setMesh(OdeScene parent_scene, IMesh mesh)
{ {
// m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh); // m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh);
@ -1132,7 +1137,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (prm.m_assetFailed) if (prm.m_assetFailed)
{ {
d.GeomSetCategoryBits(prm.prim_geom, 0); d.GeomSetCategoryBits(prm.prim_geom, 0);
d.GeomSetCollideBits(prm.prim_geom, 0); d.GeomSetCollideBits(prm.prim_geom, prm.BadAssetColideBits());
} }
else else
{ {
@ -1186,7 +1191,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_assetFailed) if (m_assetFailed)
{ {
d.GeomSetCategoryBits(prim_geom, 0); d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0); d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
} }
else else
{ {
@ -1388,7 +1393,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_assetFailed) if (m_assetFailed)
{ {
d.GeomSetCategoryBits(prim_geom, 0); d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0); d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
} }
else else
{ {
@ -2132,7 +2137,7 @@ Console.WriteLine(" JointCreateFixed");
} }
if (m_assetFailed) if (m_assetFailed)
d.GeomSetCollideBits(prim_geom, 0); d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
else else
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);