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

Forces and moving objects manually

Topics: Developer Forum, User Forum
Jun 29, 2011 at 12:06 AM

Hi There,

Couple of related problems / questions. I have an ellipse that I’m applying a force to, I’m only allowing 10 of these on screen at any one time. So when I hit 10 I’m moving the first one back to the start position and then applying a new force. The problem is occasionally I get a weird force being applied. Is this the correct way to clear / reset any forces on an object:

                   phy.BodyObject.LinearVelocity = Vector2.Zero;

                   phy.BodyObject.AngularVelocity = 0;

                   phy.BodyObject.Position = _physicsController.ScreenToWorld(new System.Windows.Point(_startVector.X, _startVector.Y));

Second problem is also about moving an object. I’ve got a portal type scenario, when my ellipse collides with portal A it’s moved to portal B. When moving the object to portal b the forces seem to be almost random. Are they relative to the position of the ellipse when it collided with portal A? How would I go about maintaining the existing forces / trajectory on the ellipse after it’s moved.