first part of bugfix [#24376] Fly mode disturbs the rotation or scale of the camera object
object_apply_mat4 was incorrectly negating the matrix values, This worked in most cases but even when it worked would end up with negative scales too often. now when no negative scale is used they will all stay positive and from my tests it works in all cases now.
This commit is contained in:
@@ -1709,11 +1709,13 @@ void object_apply_mat4(Object *ob, float mat[][4])
|
||||
* for these together since they are related. */
|
||||
copy_m3_m4(mat3, mat);
|
||||
/* so scale doesnt interfear with rotation [#24291] */
|
||||
/* note: this is a workaround for negative matrix not working for rotation conversion, FIXME */
|
||||
normalize_m3_m3(mat3_n, (const float(*)[3])mat3);
|
||||
if(mat3_n[0][0] < 0.0f) negate_v3(mat3_n[0]);
|
||||
if(mat3_n[1][1] < 0.0f) negate_v3(mat3_n[1]);
|
||||
if(mat3_n[2][2] < 0.0f) negate_v3(mat3_n[2]);
|
||||
|
||||
if(is_negative_m3(mat3_n)) {
|
||||
negate_v3(mat3_n[0]);
|
||||
negate_v3(mat3_n[1]);
|
||||
negate_v3(mat3_n[2]);
|
||||
}
|
||||
|
||||
/* rotation */
|
||||
object_mat3_to_rot(ob, mat3_n, 0);
|
||||
|
||||
Reference in New Issue
Block a user