I have two objects in box2D and would like to use ApplyForce() on each object but add more force when they are closer to each other but apply it in the vector they are currently moving?
box2D how to determine currently heading vector?,
Members - Reputation: 116
Posted 18 March 2013 - 03:07 PM
(x and y being vector components) (also, a vector formed by these new components is called a unit vector because its length is 1)
From there, you can multiply each component by force to get the force to act in the direction of the vector.