It's set by the density of the parts of the object.
What are you trying to do?
If you are using applyForce, in my experience sometimes it is easier to pass the center of the object (remember to use world coordinates, not the object's) or use setSpeed instead.
The arrow is an arrow shot by the player, the head is always pointing to the resulting strenght.
You will have to do some tests to find what final rotation you want.
The normalizedRadians function is used to keep the angles between 0 and 2pi:
static float normalizedRadians(orxFLOAT angle){
if (angle > 0){
while (angle >= orxMATH_KF_2_PI) angle -= orxMATH_KF_2_PI;
}
else{
while (angle < 0) angle += orxMATH_KF_2_PI;
}
return angle;
}
Comments
What are you trying to do?
If you are using applyForce, in my experience sometimes it is easier to pass the center of the object (remember to use world coordinates, not the object's) or use setSpeed instead.
what I am trying to do is, when the object falling with physics
a part of an object will be more heavy, and easy to touch the ground firstly
for example,
my object is a human, and he is waring a pair of very heavy boots
and the boots will touch the ground first when he fell to the ground.
sorry my english is bad. hope you can read it
This won't be physically perfect, but will work.
The arrow is an arrow shot by the player, the head is always pointing to the resulting strenght.
You will have to do some tests to find what final rotation you want.
The normalizedRadians function is used to keep the angles between 0 and 2pi:
In the original topic there are a few links to posts of people that got it done using box2d, you can find the original post here:
https://forum.orx-project.org/discussion/6390
If you are a native portuguese speaker, I can try to explain it to you in portuguese too.
btw I am from Hong Kong.