BulletSim: Add some comments (gasp) and log messages.

connector_plugin
Robert Adams 2012-09-06 08:05:53 -07:00
parent 189f51233e
commit 3c097cb7a9
4 changed files with 13 additions and 4 deletions

View File

@ -98,6 +98,10 @@ public abstract class BSConstraint : IDisposable
{
// m_world.scene.PhysicsLogging.Write("{0},BSConstraint.RecomputeConstraintVariables,taint,enabling,A={1},B={2}",
// BSScene.DetailLogZero, Body1.ID, Body2.ID);
// Setting an object's mass to zero (making it static like when it's selected)
// automatically disables the constraints.
// If enabled, be sure to set the constraint itself to enabled.
BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true));
}
else

View File

@ -245,8 +245,8 @@ public class BSLinkset
// their constraints have not been created yet.
// Caused by the fact that m_children is built at run time but building constraints
// happens at taint time.
// m_physicsScene.Logger.ErrorFormat("[BULLETSIM LINKSET] RecomputeLinksetConstraintVariables: constraint not found for root={0}, child={1}",
// m_linksetRoot.Body.ID, child.Body.ID);
// m_physicsScene.Logger.ErrorFormat("{0} RecomputeLinksetConstraintVariables: constraint not found for root={1}, child={2}",
// LogHeader, m_linksetRoot.Body.ID, child.Body.ID);
}
}
}

View File

@ -472,6 +472,10 @@ public sealed class BSPrim : BSPhysObject
// Make gravity work if the object is physical and not selected
// No locking here because only called when it is safe
// There are three flags we're interested in:
// IsStatic: Object does not move, otherwise the object has mass and moves
// isSolid: other objects bounce off of this object
// collisionEvents: whether this object returns collision events
private void SetObjectDynamic()
{
// If it's becoming dynamic, it will need hullness
@ -481,6 +485,7 @@ public sealed class BSPrim : BSPhysObject
float mass = IsStatic ? 0f : _mass;
BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
m_currentCollisionFlags = BulletSimAPI.GetCollisionFlags2(Body.Ptr);
// recompute any linkset parameters
Linkset.Refresh(this);

View File

@ -408,8 +408,8 @@ public class BSTerrainManager
int mapIndex = (int)regionY * (int)mapInfo.sizeY + (int)regionX;
ret = mapInfo.heightMap[mapIndex];
m_terrainModified = false;
DetailLog("{0},BSTerrainManager.GetTerrainHeightAtXY,bX={1},baseY={2},szX={3},szY={4},regX={5},regY={6},index={7},ht={8}",
BSScene.DetailLogZero, offsetX, offsetY, mapInfo.sizeX, mapInfo.sizeY, regionX, regionY, mapIndex, ret);
// DetailLog("{0},BSTerrainManager.GetTerrainHeightAtXY,bX={1},baseY={2},szX={3},szY={4},regX={5},regY={6},index={7},ht={8}",
// BSScene.DetailLogZero, offsetX, offsetY, mapInfo.sizeX, mapInfo.sizeY, regionX, regionY, mapIndex, ret);
}
else
{