Physics Asked on July 4, 2021
I’m making a videogame where the player controls a spaceship in a 3d environment, but the catch is the physics are realistic. The thing is, I’m struggling with 3d rotational kinematics. At first I tried manually implementing the physics, but I don’t think I did that right. Thankfully, the game engine I’m using (Godot) does offer a RigidBody class that allows me to apply forces to it and let the game’s physics engine (the bullet engine) figure things out. However, I have noticed some strange behavior that I’m not entirely sure is correct. When I apply multiple different torques at the same time, then stop applying torque, I would expect the angular velocity (given in a 3d vector) to stop changing once I stop applying torque. However, the angular velocity continues to change in both magnitude and direction, which I don’t think is physically accurate. So, I have 2 main questions.
Hopefully this is an appropriate place to ask, given that my question is more about physics than game development in my opinion.
Your understanding is correct: zero torque means that angular velocity does not change in that timestep
In 2D, angular velocity has a fairly trivial update as $Deltaomega = I^{-1}tau(t)Delta t$, where $I$ is just scalar inertia.
In 3D, however, the discrete-time update becomes $Deltaomega = QI^{-1}Q^Ttau(t)Delta t$ (assuming Euler integration), where $tau(t)$ is the total torque on the body at that timestep, $I$ is the $3times3$ inertia tensor, and and $Q$ is the (orthogonal) orientation matrix of the body.
The angular velocity is simply updated as $omega rightarrow omega+Deltaomega$ at the end of the time step.
Correct answer by Nihar Karve on July 4, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP