mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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
|
||||
if (paranoid_hpr_quat) {
|
||||
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;
|
||||
compare.set_from_matrix(mat);
|
||||
if (!compare.almost_equal(*this) && !compare.almost_equal(-(*this))) {
|
||||
@ -213,7 +213,7 @@ get_hpr(CoordinateSystem cs) const {
|
||||
FLOATNAME(LMatrix3) mat;
|
||||
extract_to_matrix(mat);
|
||||
FLOATNAME(LVecBase3) scale, compare_hpr;
|
||||
decompose_matrix(mat, scale, compare_hpr);
|
||||
decompose_matrix(mat, scale, compare_hpr, cs);
|
||||
if (!compare_hpr.almost_equal(hpr)) {
|
||||
linmath_cat.warning()
|
||||
<< "quat-to-hpr of " << *this << " computed " << hpr << " instead of "
|
||||
|
Loading…
x
Reference in New Issue
Block a user