mirror of https://github.com/zeldaret/tp
fix TPosition3.h (#2919)
This commit is contained in:
parent
ae9fa8922a
commit
9f1a648851
|
|
@ -53,7 +53,7 @@ struct SMatrix33C {
|
|||
|
||||
template <typename T>
|
||||
struct TMatrix34 : public T {
|
||||
void identity() { MTXIdentity(data); }
|
||||
void identity() { MTXIdentity(this->data); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
|
@ -62,15 +62,15 @@ struct TRotation3 : public T {};
|
|||
template<typename T>
|
||||
struct TRotation3<SMatrix33C<T> > : public SMatrix33C<T> {
|
||||
inline void getEulerXYZ(TVec3<T>* param_1) const {
|
||||
if (at(2, 0) - TUtil<T>::one() >= -TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(-at(0, 1), at(1, 1)), -TUtil<T>::halfPI(), 0.0);
|
||||
if (this->at(2, 0) - TUtil<T>::one() >= -TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(-this->at(0, 1), this->at(1, 1)), -TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
if (at(2, 0) + TUtil<T>::one() <= TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(at(0, 1), at(1, 1)), TUtil<T>::halfPI(), 0.0);
|
||||
if (this->at(2, 0) + TUtil<T>::one() <= TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(this->at(0, 1), this->at(1, 1)), TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
param_1->x = TUtil<T>::atan2(at(2, 1), at(2, 2));
|
||||
param_1->z = TUtil<T>::atan2(at(1, 0), at(0, 0));
|
||||
param_1->y = TUtil<T>::asin(-at(2, 0));
|
||||
param_1->x = TUtil<T>::atan2(this->at(2, 1), this->at(2, 2));
|
||||
param_1->z = TUtil<T>::atan2(this->at(1, 0), this->at(0, 0));
|
||||
param_1->y = TUtil<T>::asin(-this->at(2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue