This project has moved. For the latest updates, please go here.

Using a Collidable Cursor

Jul 2, 2011 at 4:30 AM
Edited Jul 2, 2011 at 4:38 AM

I've implemented a collidable cursor in one of the samples as a test example.  After some guidance from Matt B., everything seems to be working property regarding using the dynamic properties (linear velocity, etc.) to manipulate the cursor's body.  However, because the mouse's position needs to be updated to the cursor's body position after the world has stepped, it's led to some very sketchy behavior that I have not been able to track down.


I'll post the code, but I thought I'd see if anyone had any experience with anything similar.  The lines being drawn do not have collision applied to them.  To elaborate on what the issue is, those should not be zig-zagging, as the mouse is being moved in a smooth path.  The debug drawn fixture actually oscillates almost as though it it is colliding with itself.  My first thought that the body was being added twice, but I've double-checked and that is not the case.

Jul 2, 2011 at 5:21 PM

smiliar my game ?

Jul 8, 2011 at 3:01 AM
Edited Jul 8, 2011 at 3:02 AM

I uncovered the problem.  It was a simple error.  The update call was stepping the world twice.  So if anyone runs into a similar issue where a body appears to be oscillating when its linear velocity is being set manually, check that the world is only being stepped once.