BulletSim: remove all the debug printing of pointer formatting (.ToString(X)) and replace it with a method on BulletBody, BulletShape, ...

This commit is contained in:
Robert Adams
2012-12-30 10:37:37 -08:00
parent 9218748321
commit 5379d6d112
7 changed files with 58 additions and 25 deletions

View File

@@ -82,13 +82,22 @@ public class BulletBody
BulletSimData.CollisionTypeMasks[collisionType].mask);
}
// Used for log messages for a unique display of the memory/object allocated to this instance
public string AddrString
{
get
{
return ptr.ToString("X");
}
}
public override string ToString()
{
StringBuilder buff = new StringBuilder();
buff.Append("<id=");
buff.Append(ID.ToString());
buff.Append(",p=");
buff.Append(ptr.ToString("X"));
buff.Append(AddrString);
buff.Append(",c=");
buff.Append(collisionType);
buff.Append(">");
@@ -124,11 +133,20 @@ public class BulletShape
}
public bool HasPhysicalShape { get { return ptr != IntPtr.Zero; } }
// Used for log messages for a unique display of the memory/object allocated to this instance
public string AddrString
{
get
{
return ptr.ToString("X");
}
}
public override string ToString()
{
StringBuilder buff = new StringBuilder();
buff.Append("<p=");
buff.Append(ptr.ToString("X"));
buff.Append(AddrString);
buff.Append(",s=");
buff.Append(type.ToString());
buff.Append(",k=");
@@ -154,6 +172,15 @@ public class BulletConstraint
ptr = IntPtr.Zero;
}
public bool HasPhysicalConstraint { get { return ptr != IntPtr.Zero; } }
// Used for log messages for a unique display of the memory/object allocated to this instance
public string AddrString
{
get
{
return ptr.ToString("X");
}
}
}
// An allocated HeightMapThing which holds various heightmap info.