I uploaded this little patch to differential for better reviewing.
The issue fixed by this patch was: Angular velocity magnitude can't be
set to zero.
I use the same solution that was also used to allow zeroing the linear
velocities.
Differential D952
BGE: Fix for bug T41943 (zeroing out angular velocity is not posible) Authored by Sybren A. Stüvel (sybren) on Dec 22 2014, 7:26 PM.
Details I uploaded this little patch to differential for better reviewing. The issue fixed by this patch was: Angular velocity magnitude can't be
Diff Detail
Event TimelineComment Actions This looks like it could break some people's setups. I think, overall, it's worthwhile to be able to zero out angular velocity, but it would be good to get input from Dalai and/or Campbell. Comment Actions This was introduced way back (2006) in rB904a0792 by @Erwin Coumans (erwin) (Erwin, any chance you are still around?). I'm under the impression that we would run into instability issues with your patch, no? Comment Actions I've reviewing other codes on the net using setAngularVelocity and I didn't find problems by setting the velocity to zero. Additionally in my tests I haven't seen instability or vibration issues when I stop the object. Comment Actions Proposal: Comment Actions Do we have regression tests that cover this? I remember this pumpkin file that had issues before with angular velocity that I think was from the Game Kit book. Comment Actions I commandeered this diff to upload my own patch for the issue; feel free to commandeer back. My patch zeroes out tiny tiny velocities, and unifies the angular and linear velocity setters so that they use the same approach. Comment Actions The patch looks good to me, with no danger of instability. Comment Actions This is the blend that I used to test . I can not test now as I have no access to my computer until next weekI looked at pumpkim files but I didn't see any related to this. This solution I think is better. LGTM Comment Actions @Jorge Bernal (lordloki) That test file doesn't apply to this patch. The motion actuator doesn't use the physics engine, and simply performs instantaneous translations. It never calls setLinearVelocity() on the physics object, and thus this patch still doesn't make the balls hang still in the air. That's a different problem than this patch tries to solve, so that's for another patch. Comment Actions I think it applies as I'm using "linear velocity" parameter. You are describing the behaviour of using "loc" parameter. Comment Actions Ah yes, m_dloc is apparently "delta location" and not "derived location". In the actuator, parent->setLinearVelocity() is never called for zero velocities, due to m_bitLocalFlag.ZeroLinearVelocity = true. I wrote a small hack for that to investigate the actuator's behaviour; I would recommend we keep this patch closed and move to that one: D1545 |