mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
This commit is contained in:
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
|
||||
@@ -81,6 +81,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
/// </summary>
|
||||
public class BulletXMaths
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
//Vector3
|
||||
public static Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector)
|
||||
{
|
||||
@@ -311,7 +313,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
|
||||
bool needsCollision = base.NeedsCollision(bodyA, bodyB);
|
||||
|
||||
//MainLog.Instance.Debug("BulletX", "A collision was detected between {0} and {1} --> {2}", nameA, nameB,
|
||||
//m_log.Debug("[BulletX]: A collision was detected between {0} and {1} --> {2}", nameA, nameB,
|
||||
//needsCollision);
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Physics.Manager
|
||||
/// </summary>
|
||||
public class PhysicsPluginManager
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>();
|
||||
private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>();
|
||||
|
||||
@@ -60,25 +62,25 @@ namespace OpenSim.Region.Physics.Manager
|
||||
IMesher meshEngine = null;
|
||||
if (_MeshPlugins.ContainsKey(meshEngineName))
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "creating meshing engine " + meshEngineName);
|
||||
m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
|
||||
meshEngine = _MeshPlugins[meshEngineName].GetMesher();
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn("PHYSICS", "couldn't find meshingEngine: {0}", meshEngineName);
|
||||
m_log.Warn(String.Format("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName));
|
||||
throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName));
|
||||
}
|
||||
|
||||
if (_PhysPlugins.ContainsKey(physEngineName))
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "creating " + physEngineName);
|
||||
m_log.Info("[PHYSICS]: creating " + physEngineName);
|
||||
PhysicsScene result = _PhysPlugins[physEngineName].GetScene();
|
||||
result.Initialise(meshEngine);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn("PHYSICS", "couldn't find physicsEngine: {0}", physEngineName);
|
||||
m_log.Warn(String.Format("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName));
|
||||
throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName));
|
||||
}
|
||||
}
|
||||
@@ -89,7 +91,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
IMeshingPlugin plugHard;
|
||||
plugHard = new ZeroMesherPlugin();
|
||||
_MeshPlugins.Add(plugHard.GetName(), plugHard);
|
||||
MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plugHard.GetName());
|
||||
m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName());
|
||||
|
||||
// And now walk all assemblies (DLLs effectively) and see if they are home
|
||||
// of a plugin that is of interest for us
|
||||
@@ -120,7 +122,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
(IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||
plug.Init();
|
||||
_PhysPlugins.Add(plug.GetName(), plug);
|
||||
MainLog.Instance.Verbose("PHYSICS", "Added physics engine: " + plug.GetName());
|
||||
m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName());
|
||||
}
|
||||
|
||||
Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true);
|
||||
@@ -130,7 +132,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
IMeshingPlugin plug =
|
||||
(IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||
_MeshPlugins.Add(plug.GetName(), plug);
|
||||
MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plug.GetName());
|
||||
m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName());
|
||||
}
|
||||
|
||||
physTypeInterface = null;
|
||||
@@ -147,11 +149,11 @@ namespace OpenSim.Region.Physics.Manager
|
||||
{
|
||||
if (isWarning)
|
||||
{
|
||||
MainLog.Instance.Warn("PHYSICS", message);
|
||||
m_log.Warn("[PHYSICS]: " + message);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", message);
|
||||
m_log.Info("[PHYSICS]: " + message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,4 +173,4 @@ namespace OpenSim.Region.Physics.Manager
|
||||
string GetName();
|
||||
IMesher GetMesher();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using Axiom.Math;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
@@ -35,6 +36,8 @@ namespace OpenSim.Region.Physics.Manager
|
||||
|
||||
public abstract class PhysicsScene
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// The only thing that should register for this event is the InnerScene
|
||||
// Anything else could cause problems.
|
||||
|
||||
@@ -92,7 +95,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
|
||||
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddAvatar({0})", position);
|
||||
m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddAvatar({0})", position));
|
||||
return PhysicsActor.Null;
|
||||
}
|
||||
|
||||
@@ -107,7 +110,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
/*
|
||||
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
|
||||
{
|
||||
MainLog.Instance.Verbose("NullPhysicsScene : AddPrim({0},{1})", position, size);
|
||||
m_log.Info(String.Format("NullPhysicsScene : AddPrim({0},{1})", position, size));
|
||||
return PhysicsActor.Null;
|
||||
}
|
||||
*/
|
||||
@@ -121,7 +124,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
|
||||
PhysicsVector size, Quaternion rotation, bool isPhysical)
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddPrim({0},{1})", position, size);
|
||||
m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size));
|
||||
return PhysicsActor.Null;
|
||||
}
|
||||
|
||||
@@ -131,20 +134,19 @@ namespace OpenSim.Region.Physics.Manager
|
||||
|
||||
public override float Simulate(float timeStep)
|
||||
{
|
||||
m_workIndicator = (m_workIndicator + 1)%10;
|
||||
m_workIndicator = (m_workIndicator + 1) % 10;
|
||||
|
||||
//MainLog.Instance.SetStatus(m_workIndicator.ToString());
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void GetResults()
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : GetResults()");
|
||||
m_log.Info("[PHYSICS]: NullPhysicsScene : GetResults()");
|
||||
}
|
||||
|
||||
public override void SetTerrain(float[] heightMap)
|
||||
{
|
||||
MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
|
||||
m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : SetTerrain({0} items)", heightMap.Length));
|
||||
}
|
||||
|
||||
public override void DeleteTerrain()
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
|
||||
public class Meshmerizer : IMesher
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// Setting baseDir to a path will enable the dumping of raw files
|
||||
// raw files can be imported by blender so a visual inspection of the results can be done
|
||||
// const string baseDir = "rawFiles";
|
||||
@@ -101,7 +103,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
return influenced;
|
||||
}
|
||||
|
||||
|
||||
private static void InsertVertices(List<Vertex> vertices, int usedForSeed, List<Triangle> triangles)
|
||||
{
|
||||
// This is a variant of the delaunay algorithm
|
||||
@@ -174,7 +175,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size)
|
||||
// Builds the z (+ and -) surfaces of a box shaped prim
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
// Calculated separately to avoid errors
|
||||
cutHull.AddVertex(legEnd);
|
||||
|
||||
MainLog.Instance.Debug("Starting cutting of the hollow shape from the prim {1}", 0, primName);
|
||||
m_log.Debug(String.Format("Starting cutting of the hollow shape from the prim {1}", 0, primName));
|
||||
SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull);
|
||||
|
||||
outerHull = cuttedHull;
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
// is defined by the hull lies inside or outside the simplex chain
|
||||
public class SimpleHull
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private List<Vertex> vertices = new List<Vertex>();
|
||||
private List<Vertex> holeVertices = new List<Vertex>(); // Only used, when the hull is hollow
|
||||
|
||||
@@ -243,9 +245,9 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
SimpleHull otherHullClone = otherHull.Clone();
|
||||
bool intersects = false;
|
||||
|
||||
MainLog.Instance.Debug("State before intersection detection");
|
||||
MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
|
||||
MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
|
||||
m_log.Debug("State before intersection detection");
|
||||
m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
|
||||
m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
|
||||
|
||||
{
|
||||
int iBase, iOther;
|
||||
@@ -274,8 +276,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
}
|
||||
}
|
||||
|
||||
MainLog.Instance.Debug("State after intersection detection for the base hull");
|
||||
MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
|
||||
m_log.Debug("State after intersection detection for the base hull");
|
||||
m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
|
||||
|
||||
{
|
||||
int iOther, iBase;
|
||||
@@ -303,8 +305,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
}
|
||||
}
|
||||
|
||||
MainLog.Instance.Debug("State after intersection detection for the base hull");
|
||||
MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
|
||||
m_log.Debug("State after intersection detection for the base hull");
|
||||
m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
|
||||
|
||||
|
||||
bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone);
|
||||
@@ -387,7 +389,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
done = true;
|
||||
}
|
||||
|
||||
MainLog.Instance.Debug("The resulting Hull is:\n{1}", 0, result.ToString());
|
||||
m_log.Debug(String.Format("The resulting Hull is:\n{1}", 0, result.ToString()));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
public class OdeCharacter : PhysicsActor
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private PhysicsVector _position;
|
||||
private d.Vector3 _zeroPosition;
|
||||
private d.Matrix3 m_StandUpRotation;
|
||||
@@ -357,7 +359,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//capsuleradius = 0.2f;
|
||||
|
||||
CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z*0.52f))); // subtract 43% of the size
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose("SIZE", CAPSULE_LENGTH.ToString());
|
||||
m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
|
||||
d.BodyDestroy(Body);
|
||||
|
||||
_parent_scene.waitForSpaceUnlock(_parent_scene.space);
|
||||
@@ -440,7 +442,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//d.QfromR(
|
||||
//d.Matrix3 checkrotation = new d.Matrix3(0.7071068,0.5, -0.7071068,
|
||||
//
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICSAV", "Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
|
||||
//m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
|
||||
//standupStraight();
|
||||
|
||||
|
||||
@@ -479,7 +481,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
|
||||
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
|
||||
//d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICSAV", "Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
|
||||
//m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
|
||||
}
|
||||
|
||||
public override PhysicsVector Force
|
||||
|
||||
@@ -37,6 +37,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
public class OdePrim : PhysicsActor
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public PhysicsVector _position;
|
||||
private PhysicsVector _velocity;
|
||||
private PhysicsVector m_lastVelocity = new PhysicsVector(0.0f, 0.0f, 0.0f);
|
||||
@@ -530,7 +532,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Failed to load a sphere bad size");
|
||||
m_log.Info("[PHYSICS]: Failed to load a sphere bad size");
|
||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
|
||||
}
|
||||
@@ -683,7 +685,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
lock (m_forcelist)
|
||||
{
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "dequeing forcelist");
|
||||
//m_log.Info("[PHYSICS]: dequeing forcelist");
|
||||
if (IsPhysical)
|
||||
{
|
||||
PhysicsVector iforce = new PhysicsVector();
|
||||
@@ -747,7 +749,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
get { return _position; }
|
||||
|
||||
set { _position = value;
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", _position.ToString());
|
||||
//m_log.Info("[PHYSICS]: " + _position.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,7 +826,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
m_forcelist.Add(force);
|
||||
m_taintforce = true;
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Added Force:" + force.ToString() + " to prim at " + Position.ToString());
|
||||
//m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString());
|
||||
}
|
||||
|
||||
public override PhysicsVector RotationalVelocity
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
/// </summary>
|
||||
public class OdePlugin : IPhysicsPlugin
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private OdeScene _mScene;
|
||||
|
||||
public OdePlugin()
|
||||
@@ -76,6 +78,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public class OdeScene : PhysicsScene
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// TODO: this should be hard-coded in some common place
|
||||
private const uint m_regionWidth = 256;
|
||||
private const uint m_regionHeight = 256;
|
||||
@@ -284,7 +288,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
//if (id == d.GeomClassID.TriMeshClass)
|
||||
//{
|
||||
// MainLog.Instance.Verbose("near: A collision was detected between {1} and {2}", 0, name1, name2);
|
||||
// m_log.Info("near: A collision was detected between {1} and {2}", 0, name1, name2);
|
||||
//System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
|
||||
//}
|
||||
|
||||
@@ -296,8 +300,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
catch (SEHException)
|
||||
{
|
||||
MainLog.Instance.Error("PHYSICS",
|
||||
"The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
|
||||
m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
|
||||
base.TriggerPhysicsBasedRestart();
|
||||
}
|
||||
|
||||
@@ -352,7 +355,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
if (contacts[i].depth >= 1.00f)
|
||||
{
|
||||
//MainLog.Instance.Debug("PHYSICS",contacts[i].depth.ToString());
|
||||
//m_log.Debug("[PHYSICS]: " +contacts[i].depth.ToString());
|
||||
}
|
||||
|
||||
//If you interpenetrate a prim with an agent
|
||||
@@ -405,7 +408,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
if (contacts[i].depth >= 1.00f)
|
||||
{
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose("P", contacts[i].depth.ToString());
|
||||
//m_log.Info("[P]: " + contacts[i].depth.ToString());
|
||||
if ((p2.PhysicsActorType == (int) ActorTypes.Agent &&
|
||||
p1.PhysicsActorType == (int) ActorTypes.Unknown) ||
|
||||
(p1.PhysicsActorType == (int) ActorTypes.Agent &&
|
||||
@@ -654,9 +657,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'removeprim from scene':" +
|
||||
((OdePrim) prim).m_targetSpace.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" +
|
||||
((OdePrim) prim).m_targetSpace.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,9 +680,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'removeprim from scene':" +
|
||||
((OdePrim) prim).m_targetSpace.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" +
|
||||
((OdePrim) prim).m_targetSpace.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -742,9 +743,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() +
|
||||
" Geom:" + geom.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() +
|
||||
" Geom:" + geom.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -761,9 +761,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'recalculatespace':" +
|
||||
sGeomIsIn.ToString() + " Geom:" + geom.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
|
||||
sGeomIsIn.ToString() + " Geom:" + geom.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -787,9 +786,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'recalculatespace':" +
|
||||
currentspace.ToString() + " Geom:" + geom.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
|
||||
currentspace.ToString() + " Geom:" + geom.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -807,9 +805,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'recalculatespace':" +
|
||||
currentspace.ToString() + " Geom:" + geom.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
|
||||
currentspace.ToString() + " Geom:" + geom.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -826,9 +823,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Verbose("Physics",
|
||||
"Invalid Scene passed to 'recalculatespace':" +
|
||||
sGeomIsIn.ToString() + " Geom:" + geom.ToString());
|
||||
m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
|
||||
sGeomIsIn.ToString() + " Geom:" + geom.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -876,7 +872,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
IntPtr locationbasedspace =IntPtr.Zero;
|
||||
|
||||
int[] xyspace = calculateSpaceArrayItemFromPos(pos);
|
||||
//MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
|
||||
//m_log.Info("[Physics]: Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
|
||||
locationbasedspace = staticPrimspace[xyspace[0], xyspace[1]];
|
||||
|
||||
//locationbasedspace = space;
|
||||
@@ -970,7 +966,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
name2 = "null";
|
||||
}
|
||||
|
||||
MainLog.Instance.Verbose("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
|
||||
m_log.Info("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
@@ -984,19 +980,20 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
name1 = "null";
|
||||
}
|
||||
|
||||
if (!geom_name_map.TryGetValue(refObject, out name2))
|
||||
{
|
||||
name2 = "null";
|
||||
}
|
||||
|
||||
// MainLog.Instance.Verbose("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex);
|
||||
// m_log.Info("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex);
|
||||
|
||||
d.Vector3 v0 = new d.Vector3();
|
||||
d.Vector3 v1 = new d.Vector3();
|
||||
d.Vector3 v2 = new d.Vector3();
|
||||
|
||||
d.GeomTriMeshGetTriangle(trimesh, 0, ref v0, ref v1, ref v2);
|
||||
// MainLog.Instance.Debug("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z);
|
||||
// m_log.Debug("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1105,19 +1102,16 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
catch (StackOverflowException)
|
||||
{
|
||||
MainLog.Instance.Error("PHYSICS",
|
||||
"The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim.");
|
||||
m_log.Error("[PHYSICS]: The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim.");
|
||||
base.TriggerPhysicsBasedRestart();
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
||||
// Figure out the Frames Per Second we're going at.
|
||||
//(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
|
||||
fps = (step_time/ODE_STEPSIZE) * 1000;
|
||||
|
||||
|
||||
while (step_time > 0.0f)
|
||||
{
|
||||
foreach (OdeCharacter actor in _characters)
|
||||
@@ -1126,7 +1120,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
actor.collidelock = true;
|
||||
}
|
||||
|
||||
|
||||
collision_optimized(timeStep);
|
||||
d.WorldQuickStep(world, ODE_STEPSIZE);
|
||||
d.JointGroupEmpty(contactgroup);
|
||||
@@ -1178,8 +1171,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public override bool IsThreaded
|
||||
{
|
||||
get { return (false); // for now we won't be multithreaded
|
||||
}
|
||||
// for now we won't be multithreaded
|
||||
get { return (false); }
|
||||
}
|
||||
public float[] ResizeTerrain512NearestNeighbour(float[] heightMap)
|
||||
{
|
||||
@@ -1275,6 +1268,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Flatten out the array
|
||||
int i = 0;
|
||||
for (int y = 0; y < 512; y++)
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
[assembly : AssemblyVersion("1.0.*")]
|
||||
|
||||
Reference in New Issue
Block a user