Hot answers tagged

2

inertiaTensor is a Vector3, inertiaTensorRotation is a Quaternion. And from the docs for inertiaTensor: The inertia tensor is rotated by the inertiaTensorRotation. Essentially, inertiaTensor is the moment of inertia (defined as a tensor) and the inertiaTensorRotation is how that tensor is rotated. If you'd like them to be calculated automatically, you ...


2

First , your polarToComponent(magnitude, angle) { return { x: magnitude * Math.cos(angle), y: magnitude * Math.sin(angle) }; Called for each ball at start time, introduce a numeric error. So you must calculate the total velocity before starting simulation and compare with that instead of 30. Second your function checkCollisions() ...


2

Here's one of my go-to jump functions. It's similar to a Mario jump - fast at first, slowing down until reaching the top. Please excuse the syntax. I haven't used C++ in ages, and never SFML. const float GRAVITY = 9.0f; const float MAX_VELOCITY = -10.0f; const float MAX_AIR_TIME = 1.2f; float timeInAir = 0.0f; float jumpImpulseTime = 0.2f; float ...


1

That's correct. In a few cases, you will want to take into account the rigidbody.inertiaTensorRotation. It defines the rotation of the moment of inertia. However, in most cases, this is just going to be the identity quaternion.


1

The clearest way to make sense of any equation is to figure out the units. In this case, it's a bit ambiguous, but you know that velocity is m/h and that radius would be some kind of distance. v^2 is a good assumption in this case, but it is not immediately obvious why without knowing something about the units of the denominator. Just by looking at this, ...



Only top voted, non community-wiki answers of a minimum length are eligible