Merge branch 'master' of /home/opensim/var/repo/opensim
commit
2122748af1
|
@ -139,8 +139,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
string tempName = Path.GetTempFileName();
|
string tempName = Path.GetTempFileName();
|
||||||
|
|
||||||
Bitmap existingBitmap = null;
|
Bitmap existingBitmap = null;
|
||||||
Bitmap thisBitmap;
|
Bitmap thisBitmap = null;
|
||||||
Bitmap newBitmap;
|
Bitmap newBitmap = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
if (existingBitmap != null)
|
if (existingBitmap != null)
|
||||||
existingBitmap.Dispose();
|
existingBitmap.Dispose();
|
||||||
|
|
||||||
|
if (thisBitmap != null)
|
||||||
thisBitmap.Dispose();
|
thisBitmap.Dispose();
|
||||||
|
|
||||||
|
if (newBitmap != null)
|
||||||
newBitmap.Dispose();
|
newBitmap.Dispose();
|
||||||
|
|
||||||
if (File.Exists(tempName))
|
if (File.Exists(tempName))
|
||||||
|
|
|
@ -156,7 +156,15 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IntPtr m_targetSpace = IntPtr.Zero;
|
public IntPtr m_targetSpace = IntPtr.Zero;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The prim geometry, used for collision detection.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is never null except for a brief period when the geometry needs to be replaced (due to resizing or
|
||||||
|
/// mesh change) or when the physical prim is being removed from the scene.
|
||||||
|
/// </remarks>
|
||||||
public IntPtr prim_geom { get; private set; }
|
public IntPtr prim_geom { get; private set; }
|
||||||
|
|
||||||
public IntPtr _triMeshData { get; private set; }
|
public IntPtr _triMeshData { get; private set; }
|
||||||
|
|
||||||
private IntPtr _linkJointGroup = IntPtr.Zero;
|
private IntPtr _linkJointGroup = IntPtr.Zero;
|
||||||
|
@ -325,14 +333,11 @@ 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 (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (childPrim)
|
if (childPrim)
|
||||||
{
|
{
|
||||||
|
@ -765,11 +770,8 @@ 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 (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
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)
|
||||||
|
@ -793,11 +795,8 @@ 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 (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -863,12 +862,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
try
|
try
|
||||||
{
|
|
||||||
if (prim_geom == IntPtr.Zero)
|
|
||||||
{
|
{
|
||||||
SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null));
|
SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (AccessViolationException)
|
catch (AccessViolationException)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[PHYSICS]: MESH LOCKED FOR {0}", Name);
|
m_log.ErrorFormat("[PHYSICS]: MESH LOCKED FOR {0}", Name);
|
||||||
|
@ -890,13 +886,12 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
#if SPAM
|
#if SPAM
|
||||||
Console.WriteLine("ZProcessTaints for " + Name);
|
Console.WriteLine("ZProcessTaints for " + Name);
|
||||||
#endif
|
#endif
|
||||||
if (m_taintadd)
|
|
||||||
{
|
|
||||||
changeadd();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
// This must be processed as the very first taint so that later operations have a prim_geom to work with
|
||||||
{
|
// if this is a new prim.
|
||||||
|
if (m_taintadd)
|
||||||
|
changeadd();
|
||||||
|
|
||||||
if (!_position.ApproxEquals(m_taintposition, 0f))
|
if (!_position.ApproxEquals(m_taintposition, 0f))
|
||||||
changemove();
|
changemove();
|
||||||
|
|
||||||
|
@ -953,11 +948,6 @@ Console.WriteLine("ZProcessTaints for " + Name);
|
||||||
if (!m_angularlock.ApproxEquals(m_taintAngularLock,0f))
|
if (!m_angularlock.ApproxEquals(m_taintAngularLock,0f))
|
||||||
changeAngularLock();
|
changeAngularLock();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat("[PHYSICS]: The scene reused a disposed PhysActor for {0}! *waves finger*, Don't be evil. A couple of things can cause this. An improper prim breakdown(be sure to set prim_geom to zero after d.GeomDestroy! An improper buildup (creating the geom failed). Or, the Scene Reused a physics actor after disposing it.)", Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Change prim in response to an angular lock taint.
|
/// Change prim in response to an angular lock taint.
|
||||||
|
@ -1093,18 +1083,10 @@ Console.WriteLine("ZProcessTaints for " + Name);
|
||||||
prm.m_collisionCategories |= CollisionCategories.Body;
|
prm.m_collisionCategories |= CollisionCategories.Body;
|
||||||
prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
|
prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
|
||||||
|
|
||||||
if (prm.prim_geom == IntPtr.Zero)
|
|
||||||
{
|
|
||||||
m_log.WarnFormat(
|
|
||||||
"[PHYSICS]: Unable to link one of the linkset elements {0} for parent {1}. No geom yet",
|
|
||||||
prm.Name, prim.Name);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//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);
|
||||||
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;
|
||||||
quat.X = prm._orientation.X;
|
quat.X = prm._orientation.X;
|
||||||
|
@ -1303,11 +1285,8 @@ Console.WriteLine("ZProcessTaints for " + Name);
|
||||||
disableBodySoft();
|
disableBodySoft();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -1328,11 +1307,8 @@ Console.WriteLine("ZProcessTaints for " + Name);
|
||||||
if (m_collidesWater)
|
if (m_collidesWater)
|
||||||
m_collisionFlags |= CollisionCategories.Water;
|
m_collisionFlags |= CollisionCategories.Water;
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -1472,6 +1448,9 @@ Console.WriteLine("CreateGeom:");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[ODE PRIM]: Called RemoveGeom() on {0} {1} where geometry was already null.", Name, LocalID);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1505,8 +1484,6 @@ Console.WriteLine("changeadd 1");
|
||||||
#endif
|
#endif
|
||||||
CreateGeom(m_targetSpace, mesh);
|
CreateGeom(m_targetSpace, mesh);
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||||
d.Quaternion myrot = new d.Quaternion();
|
d.Quaternion myrot = new d.Quaternion();
|
||||||
myrot.X = _orientation.X;
|
myrot.X = _orientation.X;
|
||||||
|
@ -1514,7 +1491,6 @@ Console.WriteLine("changeadd 1");
|
||||||
myrot.Z = _orientation.Z;
|
myrot.Z = _orientation.Z;
|
||||||
myrot.W = _orientation.W;
|
myrot.W = _orientation.W;
|
||||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||||
}
|
|
||||||
|
|
||||||
if (IsPhysical && Body == IntPtr.Zero)
|
if (IsPhysical && Body == IntPtr.Zero)
|
||||||
enableBody();
|
enableBody();
|
||||||
|
@ -1579,8 +1555,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
//m_log.Debug("[BUG]: race!");
|
//m_log.Debug("[BUG]: race!");
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// string primScenAvatarIn = _parent_scene.whichspaceamIin(_position);
|
// string primScenAvatarIn = _parent_scene.whichspaceamIin(_position);
|
||||||
// int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
|
// int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
|
||||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
|
@ -1589,14 +1564,11 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
m_targetSpace = tempspace;
|
m_targetSpace = tempspace;
|
||||||
|
|
||||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
if (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||||
|
|
||||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
d.SpaceAdd(m_targetSpace, prim_geom);
|
d.SpaceAdd(m_targetSpace, prim_geom);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
changeSelectedStatus();
|
changeSelectedStatus();
|
||||||
|
|
||||||
|
@ -2047,8 +2019,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
m_collidesWater = m_taintCollidesWater;
|
m_collidesWater = m_taintCollidesWater;
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
if (m_collidesWater)
|
if (m_collidesWater)
|
||||||
{
|
{
|
||||||
m_collisionFlags |= CollisionCategories.Water;
|
m_collisionFlags |= CollisionCategories.Water;
|
||||||
|
@ -2057,9 +2027,9 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
m_collisionFlags &= ~CollisionCategories.Water;
|
m_collisionFlags &= ~CollisionCategories.Water;
|
||||||
}
|
}
|
||||||
|
|
||||||
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.
|
||||||
|
|
Loading…
Reference in New Issue