2013-01-23 01:52:46 -05:00
|
|
|
#ifndef _EXTENDEDMOVE_H_
|
|
|
|
|
#define _EXTENDEDMOVE_H_
|
|
|
|
|
|
|
|
|
|
#include "T3D/gameBase/moveManager.h"
|
|
|
|
|
#include "math/mQuat.h"
|
|
|
|
|
|
|
|
|
|
struct ExtendedMove : public Move
|
|
|
|
|
{
|
|
|
|
|
typedef Move Parent;
|
|
|
|
|
|
|
|
|
|
enum Constants {
|
2013-04-09 13:30:25 -04:00
|
|
|
MaxPositionsRotations = 3,
|
2013-01-23 01:52:46 -05:00
|
|
|
|
2016-05-10 22:13:04 +01:00
|
|
|
MaxPositionBits = 16,
|
2013-04-09 13:30:25 -04:00
|
|
|
MaxRotationBits = 16,
|
2013-01-23 01:52:46 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Position is in millimeters
|
2016-05-10 22:13:04 +01:00
|
|
|
F32 posX[MaxPositionsRotations], posY[MaxPositionsRotations], posZ[MaxPositionsRotations];
|
|
|
|
|
|
|
|
|
|
S32 cposX[MaxPositionsRotations], cposY[MaxPositionsRotations], cposZ[MaxPositionsRotations];
|
2013-01-23 01:52:46 -05:00
|
|
|
|
2013-04-09 13:30:25 -04:00
|
|
|
bool EulerBasedRotation[MaxPositionsRotations];
|
|
|
|
|
|
2013-01-23 01:52:46 -05:00
|
|
|
F32 rotX[MaxPositionsRotations], rotY[MaxPositionsRotations], rotZ[MaxPositionsRotations], rotW[MaxPositionsRotations];
|
|
|
|
|
|
|
|
|
|
// Network clamped rotation
|
|
|
|
|
S32 crotX[MaxPositionsRotations], crotY[MaxPositionsRotations], crotZ[MaxPositionsRotations], crotW[MaxPositionsRotations];
|
|
|
|
|
|
|
|
|
|
ExtendedMove();
|
|
|
|
|
|
2024-03-18 18:40:22 +00:00
|
|
|
void pack(BitStream *stream, const Move * move = NULL) override;
|
|
|
|
|
void unpack(BitStream *stream, const Move * move = NULL) override;
|
2013-01-23 01:52:46 -05:00
|
|
|
|
2024-03-18 18:40:22 +00:00
|
|
|
void clamp() override;
|
|
|
|
|
void unclamp() override;
|
2013-01-23 01:52:46 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern const ExtendedMove NullExtendedMove;
|
|
|
|
|
|
|
|
|
|
class ExtendedMoveManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-06-15 00:12:27 +01:00
|
|
|
static F32 mPosX[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
static F32 mPosY[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
static F32 mPosZ[ExtendedMove::MaxPositionsRotations];
|
2013-04-09 13:30:25 -04:00
|
|
|
static bool mRotIsEuler[ExtendedMove::MaxPositionsRotations];
|
2013-01-23 01:52:46 -05:00
|
|
|
static F32 mRotAX[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
static F32 mRotAY[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
static F32 mRotAZ[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
static F32 mRotAA[ExtendedMove::MaxPositionsRotations];
|
|
|
|
|
|
2016-06-15 00:12:27 +01:00
|
|
|
static F32 mPosScale;
|
|
|
|
|
|
2013-01-23 01:52:46 -05:00
|
|
|
static void init();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // _EXTENDEDMOVE_H_
|