BulletSim: Add some comments (gasp) and log messages.
parent
189f51233e
commit
3c097cb7a9
|
@ -98,6 +98,10 @@ public abstract class BSConstraint : IDisposable
|
||||||
{
|
{
|
||||||
// m_world.scene.PhysicsLogging.Write("{0},BSConstraint.RecomputeConstraintVariables,taint,enabling,A={1},B={2}",
|
// m_world.scene.PhysicsLogging.Write("{0},BSConstraint.RecomputeConstraintVariables,taint,enabling,A={1},B={2}",
|
||||||
// BSScene.DetailLogZero, Body1.ID, Body2.ID);
|
// 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));
|
BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -245,8 +245,8 @@ public class BSLinkset
|
||||||
// their constraints have not been created yet.
|
// their constraints have not been created yet.
|
||||||
// Caused by the fact that m_children is built at run time but building constraints
|
// Caused by the fact that m_children is built at run time but building constraints
|
||||||
// happens at taint time.
|
// happens at taint time.
|
||||||
// m_physicsScene.Logger.ErrorFormat("[BULLETSIM LINKSET] RecomputeLinksetConstraintVariables: constraint not found for root={0}, child={1}",
|
// m_physicsScene.Logger.ErrorFormat("{0} RecomputeLinksetConstraintVariables: constraint not found for root={1}, child={2}",
|
||||||
// m_linksetRoot.Body.ID, child.Body.ID);
|
// LogHeader, m_linksetRoot.Body.ID, child.Body.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -472,6 +472,10 @@ public sealed class BSPrim : BSPhysObject
|
||||||
|
|
||||||
// Make gravity work if the object is physical and not selected
|
// Make gravity work if the object is physical and not selected
|
||||||
// No locking here because only called when it is safe
|
// 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()
|
private void SetObjectDynamic()
|
||||||
{
|
{
|
||||||
// If it's becoming dynamic, it will need hullness
|
// If it's becoming dynamic, it will need hullness
|
||||||
|
@ -481,6 +485,7 @@ public sealed class BSPrim : BSPhysObject
|
||||||
float mass = IsStatic ? 0f : _mass;
|
float mass = IsStatic ? 0f : _mass;
|
||||||
|
|
||||||
BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
|
BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
|
||||||
|
m_currentCollisionFlags = BulletSimAPI.GetCollisionFlags2(Body.Ptr);
|
||||||
|
|
||||||
// recompute any linkset parameters
|
// recompute any linkset parameters
|
||||||
Linkset.Refresh(this);
|
Linkset.Refresh(this);
|
||||||
|
|
|
@ -408,8 +408,8 @@ public class BSTerrainManager
|
||||||
int mapIndex = (int)regionY * (int)mapInfo.sizeY + (int)regionX;
|
int mapIndex = (int)regionY * (int)mapInfo.sizeY + (int)regionX;
|
||||||
ret = mapInfo.heightMap[mapIndex];
|
ret = mapInfo.heightMap[mapIndex];
|
||||||
m_terrainModified = false;
|
m_terrainModified = false;
|
||||||
DetailLog("{0},BSTerrainManager.GetTerrainHeightAtXY,bX={1},baseY={2},szX={3},szY={4},regX={5},regY={6},index={7},ht={8}",
|
// 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);
|
// BSScene.DetailLogZero, offsetX, offsetY, mapInfo.sizeX, mapInfo.sizeY, regionX, regionY, mapIndex, ret);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue