Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Nikolay Korolev 2020-04-25 21:46:15 +03:00
commit fbca45239d
4 changed files with 18 additions and 5 deletions

2
librw

@ -1 +1 @@
Subproject commit d8d13d44293a58b58d51c3a8e91e3ea76c6d6feb
Subproject commit 43190a51f799a3ef315c0b6245b70ee3a09a64ac

View File

@ -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"

View File

@ -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
{

View File

@ -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);