mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
fix paranoid-hpr-quat in non-standard coordinate systems
This commit is contained in:
parent
9768307f57
commit
eacf0ccd13
@ -116,7 +116,7 @@ set_hpr(const FLOATNAME(LVecBase3) &hpr, CoordinateSystem cs) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (paranoid_hpr_quat) {
|
if (paranoid_hpr_quat) {
|
||||||
FLOATNAME(LMatrix3) mat;
|
FLOATNAME(LMatrix3) mat;
|
||||||
compose_matrix(mat, FLOATNAME(LVecBase3)(1.0f, 1.0f, 1.0f), hpr);
|
compose_matrix(mat, FLOATNAME(LVecBase3)(1.0f, 1.0f, 1.0f), hpr, cs);
|
||||||
FLOATNAME(LQuaternion) compare;
|
FLOATNAME(LQuaternion) compare;
|
||||||
compare.set_from_matrix(mat);
|
compare.set_from_matrix(mat);
|
||||||
if (!compare.almost_equal(*this) && !compare.almost_equal(-(*this))) {
|
if (!compare.almost_equal(*this) && !compare.almost_equal(-(*this))) {
|
||||||
@ -213,7 +213,7 @@ get_hpr(CoordinateSystem cs) const {
|
|||||||
FLOATNAME(LMatrix3) mat;
|
FLOATNAME(LMatrix3) mat;
|
||||||
extract_to_matrix(mat);
|
extract_to_matrix(mat);
|
||||||
FLOATNAME(LVecBase3) scale, compare_hpr;
|
FLOATNAME(LVecBase3) scale, compare_hpr;
|
||||||
decompose_matrix(mat, scale, compare_hpr);
|
decompose_matrix(mat, scale, compare_hpr, cs);
|
||||||
if (!compare_hpr.almost_equal(hpr)) {
|
if (!compare_hpr.almost_equal(hpr)) {
|
||||||
linmath_cat.warning()
|
linmath_cat.warning()
|
||||||
<< "quat-to-hpr of " << *this << " computed " << hpr << " instead of "
|
<< "quat-to-hpr of " << *this << " computed " << hpr << " instead of "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user