Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

connector_plugin
Justin Clark-Casey (justincc) 2012-10-19 02:52:12 +01:00
commit 71b73d6dc3
2 changed files with 103 additions and 21 deletions

View File

@ -4584,6 +4584,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations); Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations);
rot.Normalize();
UpdateRotation(rot); UpdateRotation(rot);
m_APIDIterations--; m_APIDIterations--;

View File

@ -341,8 +341,17 @@ namespace OpenSim.Region.Physics.OdePlugin
prim_geom = geom; prim_geom = geom;
//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name); //Console.WriteLine("SetGeom to " + prim_geom + " for " + Name);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
}
else
{
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
_parent_scene.geom_name_map[prim_geom] = Name; _parent_scene.geom_name_map[prim_geom] = Name;
_parent_scene.actor_name_map[prim_geom] = this; _parent_scene.actor_name_map[prim_geom] = this;
@ -405,8 +414,17 @@ namespace OpenSim.Region.Physics.OdePlugin
myrot.W = _orientation.W; myrot.W = _orientation.W;
d.BodySetQuaternion(Body, ref myrot); d.BodySetQuaternion(Body, ref myrot);
d.GeomSetBody(prim_geom, Body); d.GeomSetBody(prim_geom, Body);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
}
else
{
m_collisionCategories |= CollisionCategories.Body; m_collisionCategories |= CollisionCategories.Body;
m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
}
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
@ -778,8 +796,16 @@ namespace OpenSim.Region.Physics.OdePlugin
m_collisionCategories &= ~CollisionCategories.Body; m_collisionCategories &= ~CollisionCategories.Body;
m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land); m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0);
}
else
{
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
d.BodyDestroy(Body); d.BodyDestroy(Body);
lock (childrenPrim) lock (childrenPrim)
@ -803,8 +829,17 @@ namespace OpenSim.Region.Physics.OdePlugin
m_collisionCategories &= ~CollisionCategories.Body; m_collisionCategories &= ~CollisionCategories.Body;
m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land); m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0);
}
else
{
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
Body = IntPtr.Zero; Body = IntPtr.Zero;
} }
@ -816,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);
@ -1094,8 +1134,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name);
if (prm.m_assetFailed)
{
d.GeomSetCategoryBits(prm.prim_geom, 0);
d.GeomSetCollideBits(prm.prim_geom, prm.BadAssetColideBits());
}
else
{
d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
}
d.Quaternion quat = new d.Quaternion(); d.Quaternion quat = new d.Quaternion();
quat.W = prm._orientation.W; quat.W = prm._orientation.W;
@ -1140,10 +1188,18 @@ Console.WriteLine("ZProcessTaints for " + Name);
m_collisionCategories |= CollisionCategories.Body; m_collisionCategories |= CollisionCategories.Body;
m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
}
else
{
//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
//Console.WriteLine(" Post GeomSetCategoryBits 2"); //Console.WriteLine(" Post GeomSetCategoryBits 2");
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
d.Quaternion quat2 = new d.Quaternion(); d.Quaternion quat2 = new d.Quaternion();
quat2.W = _orientation.W; quat2.W = _orientation.W;
@ -1304,8 +1360,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
disableBodySoft(); disableBodySoft();
} }
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, 0);
}
else
{
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
if (IsPhysical) if (IsPhysical)
{ {
@ -1326,8 +1390,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
if (m_collidesWater) if (m_collidesWater)
m_collisionFlags |= CollisionCategories.Water; m_collisionFlags |= CollisionCategories.Water;
if (m_assetFailed)
{
d.GeomSetCategoryBits(prim_geom, 0);
d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
}
else
{
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
if (IsPhysical) if (IsPhysical)
{ {
@ -1504,6 +1576,8 @@ Console.WriteLine("CreateGeom:");
// m_log.Debug(m_localID); // m_log.Debug(m_localID);
if (mesh == null) if (mesh == null)
CheckMeshAsset(); CheckMeshAsset();
else
m_assetFailed = false;
} }
#if SPAM #if SPAM
@ -2007,6 +2081,8 @@ Console.WriteLine(" JointCreateFixed");
mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
if (mesh == null) if (mesh == null)
CheckMeshAsset(); CheckMeshAsset();
else
m_assetFailed = false;
} }
} }
@ -2060,9 +2136,12 @@ Console.WriteLine(" JointCreateFixed");
m_collisionFlags &= ~CollisionCategories.Water; m_collisionFlags &= ~CollisionCategories.Water;
} }
if (m_assetFailed)
d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
else
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
} }
/// <summary> /// <summary>
/// Change prim in response to a shape taint. /// Change prim in response to a shape taint.
/// </summary> /// </summary>
@ -2110,6 +2189,8 @@ Console.WriteLine(" JointCreateFixed");
mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
if (mesh == null) if (mesh == null)
CheckMeshAsset(); CheckMeshAsset();
else
m_assetFailed = false;
} }
CreateGeom(m_targetSpace, mesh); CreateGeom(m_targetSpace, mesh);
@ -3278,7 +3359,7 @@ Console.WriteLine(" JointCreateFixed");
_pbs.SculptData = new byte[asset.Data.Length]; _pbs.SculptData = new byte[asset.Data.Length];
asset.Data.CopyTo(_pbs.SculptData, 0); asset.Data.CopyTo(_pbs.SculptData, 0);
m_assetFailed = false; // m_assetFailed = false;
m_taintshape = true; m_taintshape = true;
_parent_scene.AddPhysicsActorTaint(this); _parent_scene.AddPhysicsActorTaint(this);
} }