Integrating output from a sensor with physics

Hullo, we are trying to set the location of an object on the screen by taking data from an external device while using physics for detecting edges for bouncing. Yet, albeit callBack contactEnded is normally called when reaching edges, the object does not bounce against the walls. We tried removing the b.setPosition(positionX,positionY); call and again normal physics applies. Even mouse inputs have effects on data. How may we input a brand new couple of screen coordinates to an FCircle and take advantage on the physics engine to have it bounce? On a similar vein, we also tried changing gravity to simulate acceleration, but in that case the object does not even move. Any suggestion?

Thanks, Fabrizio

Tagged:

Answers

  • I think we'd need to see some code to properly help... What physics engine do you mean? One you have coded yourself?

    From what you describe one possible problem with bouncing off walls is if you reverse the direction of the ball, but don't also place it back inside the walls, it can still be outside the walls on the next frame. If you're reversing direction with something like vx *= -1 then you will change its direction again to move further outside the walls and it will stay stuck.

Sign In or Register to comment.