diff options
author | aap <aap@papnet.eu> | 2020-04-25 15:56:20 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-04-25 15:56:20 +0200 |
commit | ea79cc4469dbe377e2da9e5019c1d709e95140d0 (patch) | |
tree | 825f07f2c985827d0732505e845605e53d3040b9 | |
parent | fixed shooting target (diff) | |
download | re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar.gz re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar.bz2 re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar.lz re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar.xz re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.tar.zst re3-ea79cc4469dbe377e2da9e5019c1d709e95140d0.zip |
m--------- | librw | 0 | ||||
-rw-r--r-- | src/fakerw/fake.cpp | 4 | ||||
-rw-r--r-- | src/fakerw/rphanim.h | 10 | ||||
-rw-r--r-- | src/fakerw/rtquat.h | 7 |
4 files changed, 17 insertions, 4 deletions
diff --git a/librw b/librw -Subproject d8d13d44293a58b58d51c3a8e91e3ea76c6d6fe +Subproject 43190a51f799a3ef315c0b6245b70ee3a09a64a diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index dca15dd0..c4ff2dd2 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -787,8 +787,8 @@ RwImage *RtBMPImageRead(const RwChar * imageName) { return rw::readBMP(imageName #include "rtquat.h" -RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return quat->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); } -void RtQuatConvertToMatrix(const RtQuat * const qpQuat, RwMatrix * const mpMatrix) { mpMatrix->rotate(*qpQuat, COMBINEREPLACE); } +RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); } +void RtQuatConvertToMatrix(const RtQuat * const qpQuat, RwMatrix * const mpMatrix) { mpMatrix->rotate(*(rw::Quat*)qpQuat, COMBINEREPLACE); } #include "rtcharse.h" diff --git a/src/fakerw/rphanim.h b/src/fakerw/rphanim.h index 34dfeb09..6ece8306 100644 --- a/src/fakerw/rphanim.h +++ b/src/fakerw/rphanim.h @@ -9,7 +9,15 @@ typedef rw::Animation RpHAnimAnimation; #define rpHANIMSTDKEYFRAMETYPEID 0x1 -typedef rw::HAnimKeyFrame RpHAnimStdKeyFrame; +// same as rw::HAnimKeyFrame, but we need RtQuat in this one +struct RpHAnimStdKeyFrame +{ + RpHAnimStdKeyFrame *prevFrame; + RwReal time; + RtQuat q; + RwV3d t; +}; + enum RpHAnimHierarchyFlag { diff --git a/src/fakerw/rtquat.h b/src/fakerw/rtquat.h index 3cf15f5a..450342b2 100644 --- a/src/fakerw/rtquat.h +++ b/src/fakerw/rtquat.h @@ -1,6 +1,11 @@ #pragma once -typedef rw::Quat RtQuat; +// Same layout as rw::Quat but with ugly imag,real separation which i don't want in librw +struct RtQuat +{ + rw::V3d imag; + rw::float32 real; +}; RwBool RtQuatConvertFromMatrix(RtQuat * const qpQuat, const RwMatrix * const mpMatrix); RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp); |