A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by JoshKlint » Thu Sep 09, 2021 3:19 am
I know this was discussed previously, but I can't seem to find the right topic.
Does my equation for applying a force at a specific position look correct? It seems wrong to me that nothing is being subtracted from the force value:
- Code: Select all
void Entity::AddPointForce(const Vec3& force, const Vec3& position)
{
Vec3 torque = position.Cross(force);
torque.x = Degrees(torque.x);
torque.y = Degrees(torque.y);
torque.z = Degrees(torque.z);
AddForce(force);
AddTorque(torque);
}
-
JoshKlint
-
- Posts: 163
- Joined: Sun Dec 10, 2017 8:03 pm
-
by Julio Jerez » Thu Sep 09, 2021 10:12 am
No. You need to get the center of mass and substract for the position.
There is a function in the sdk that does that.
You can check the source.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 57 guests