mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
debug messages
This commit is contained in:
parent
90918d5f6c
commit
1bc836605f
@ -27,14 +27,15 @@ compose_matrix(FLOATNAME(LMatrix3) &mat,
|
|||||||
const FLOATNAME(LVecBase3) &hpr,
|
const FLOATNAME(LVecBase3) &hpr,
|
||||||
CoordinateSystem cs) {
|
CoordinateSystem cs) {
|
||||||
|
|
||||||
// temp_hpr_fix blocks use the correct way. need to keep other way as default until
|
// temp_hpr_fix blocks use the correct way. need to keep other way
|
||||||
// legacy tools are fixed to work with correct way
|
// as default until legacy tools are fixed to work with correct way
|
||||||
|
|
||||||
if (temp_hpr_fix) {
|
if (temp_hpr_fix) {
|
||||||
mat.scale_multiply(scale,
|
mat.scale_multiply(scale,
|
||||||
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[2], FLOATNAME(LVector3)::forward(cs), cs) *
|
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[2], FLOATNAME(LVector3)::forward(cs), cs) *
|
||||||
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
||||||
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[0], FLOATNAME(LVector3)::up(cs), cs));
|
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[0], FLOATNAME(LVector3)::up(cs), cs));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mat.scale_multiply(scale,
|
mat.scale_multiply(scale,
|
||||||
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
||||||
@ -523,6 +524,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
cs = default_coordinate_system;
|
cs = default_coordinate_system;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (linmath_cat.is_debug()) {
|
||||||
|
linmath_cat.debug()
|
||||||
|
<< "decomposing " << mat << " via cs " << cs << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Extract the rotation and scale, according to the coordinate
|
// Extract the rotation and scale, according to the coordinate
|
||||||
// system of choice.
|
// system of choice.
|
||||||
bool bMatHasNoShear,bIsLeftHandedMat;
|
bool bMatHasNoShear,bIsLeftHandedMat;
|
||||||
@ -550,11 +556,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
new_mat._m.m._12 = -new_mat._m.m._12;
|
new_mat._m.m._12 = -new_mat._m.m._12;
|
||||||
new_mat._m.m._20 = -new_mat._m.m._20;
|
new_mat._m.m._20 = -new_mat._m.m._20;
|
||||||
new_mat._m.m._21 = -new_mat._m.m._21;
|
new_mat._m.m._21 = -new_mat._m.m._21;
|
||||||
/*
|
/*
|
||||||
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
||||||
mat(1, 0), mat(1, 1), -mat(1, 2),
|
mat(1, 0), mat(1, 1), -mat(1, 2),
|
||||||
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
||||||
*/
|
*/
|
||||||
unwind_zup_rotation(new_mat, hpr);
|
unwind_zup_rotation(new_mat, hpr);
|
||||||
bIsLeftHandedMat = true;
|
bIsLeftHandedMat = true;
|
||||||
}
|
}
|
||||||
@ -566,11 +572,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
new_mat._m.m._12 = -new_mat._m.m._12;
|
new_mat._m.m._12 = -new_mat._m.m._12;
|
||||||
new_mat._m.m._20 = -new_mat._m.m._20;
|
new_mat._m.m._20 = -new_mat._m.m._20;
|
||||||
new_mat._m.m._21 = -new_mat._m.m._21;
|
new_mat._m.m._21 = -new_mat._m.m._21;
|
||||||
/*
|
/*
|
||||||
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
||||||
mat(1, 0), mat(1, 1), -mat(1, 2),
|
mat(1, 0), mat(1, 1), -mat(1, 2),
|
||||||
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
||||||
*/
|
*/
|
||||||
unwind_yup_rotation(new_mat, hpr);
|
unwind_yup_rotation(new_mat, hpr);
|
||||||
bIsLeftHandedMat = true;
|
bIsLeftHandedMat = true;
|
||||||
}
|
}
|
||||||
@ -582,6 +588,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (linmath_cat.is_debug()) {
|
||||||
|
linmath_cat.debug()
|
||||||
|
<< "after unwind, mat is " << new_mat << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
scale[2] = new_mat._m.m._22;
|
scale[2] = new_mat._m.m._22;
|
||||||
if(bIsLeftHandedMat) {
|
if(bIsLeftHandedMat) {
|
||||||
scale[0] = -new_mat._m.m._00;
|
scale[0] = -new_mat._m.m._00;
|
||||||
@ -649,11 +660,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
new_mat._m.m._12 = -new_mat._m.m._12;
|
new_mat._m.m._12 = -new_mat._m.m._12;
|
||||||
new_mat._m.m._20 = -new_mat._m.m._20;
|
new_mat._m.m._20 = -new_mat._m.m._20;
|
||||||
new_mat._m.m._21 = -new_mat._m.m._21;
|
new_mat._m.m._21 = -new_mat._m.m._21;
|
||||||
/*
|
/*
|
||||||
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
||||||
mat(1, 0), mat(1, 1), -mat(1, 2),
|
mat(1, 0), mat(1, 1), -mat(1, 2),
|
||||||
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
||||||
*/
|
*/
|
||||||
unwind_zup_rotation(new_mat, hpr, roll);
|
unwind_zup_rotation(new_mat, hpr, roll);
|
||||||
bIsLeftHandedMat = true;
|
bIsLeftHandedMat = true;
|
||||||
}
|
}
|
||||||
@ -665,11 +676,11 @@ decompose_matrix(const FLOATNAME(LMatrix3) &mat,
|
|||||||
new_mat._m.m._12 = -new_mat._m.m._12;
|
new_mat._m.m._12 = -new_mat._m.m._12;
|
||||||
new_mat._m.m._20 = -new_mat._m.m._20;
|
new_mat._m.m._20 = -new_mat._m.m._20;
|
||||||
new_mat._m.m._21 = -new_mat._m.m._21;
|
new_mat._m.m._21 = -new_mat._m.m._21;
|
||||||
/*
|
/*
|
||||||
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
FLOATNAME(LMatrix3) lm(mat(0, 0), mat(0, 1), -mat(0, 2),
|
||||||
mat(1, 0), mat(1, 1), -mat(1, 2),
|
mat(1, 0), mat(1, 1), -mat(1, 2),
|
||||||
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
-mat(2, 0), -mat(2, 1), mat(2, 2));
|
||||||
*/
|
*/
|
||||||
unwind_yup_rotation(new_mat, hpr, roll);
|
unwind_yup_rotation(new_mat, hpr, roll);
|
||||||
bIsLeftHandedMat = true;
|
bIsLeftHandedMat = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user