Bug in PhysicsDemo

Feb 7, 2010 at 4:56 AM

I've been looking at the PhysicsDemo included in the Ox source (v2.2.0.0) and the initial run of it didn't work.  All I saw was the terrain, and the camera was still with no balls visible.  I believe the problem is in PhysicsBall.UpdateHook where it attempts to update the model position to match the body position.  The line currently reads "Position = body.Position;" but this calls the shadowed version of Position in the PhysicsBall class which in turn tries to body position to match the model position, so the body and model are constantly trying to match each other and the balls don't move.  I've replaced that line with "base.Position = body.Position;" and now it seems to work correctly.

Feb 7, 2010 at 5:05 AM

Ah, thanks Kermitt. I knew there was a bug, but it's one I couldn't solve visually without an XNA-compliant video card.

Will check in fix in a moment :)

Feb 7, 2010 at 9:14 AM

yeah, well done mate, this was puzzling me too, as i want to use similar code for populating a forest. :D

Feb 8, 2010 at 6:37 AM

Glad I could help :)