The camera-aiming code was using a near-zero-length cross product, which
caused oscillations. Thresholding on the cross product length seems to
fix this.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
The general method here looks good for me.
Problem is, I don't really like to use artificial values like 0.01 as threshold... Couldn't we test for fuzzy 0 instead?
Comment Actions
We can use Mt_fuzzyzero although I didn't check yet if MT_EPSILON is enough to reach stability (or we need a bigger number)
| source/gameengine/Ketsji/KX_CameraActuator.cpp | ||
|---|---|---|
| 297 | As @Quentin Wenger (Matpi) says we can use: if (cross > 0.0f && !MT_fuzzyzero(cross)) | |
| 301 | and here: if (cross < 0.0f && !MT_fuzzyzero(cross)) | |
Comment Actions
I check it using fuzzyzero but it seems to work much better using 0.01f. So LGTM for me.
Comment Actions
Thanks for checking. I would have liked to use such a constant (and checked FLT_EPSILON, but that also doesn't work), but this indeed works better. Thanks for accepting the patch, I'll commit soon.