mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
ExtendedMove class and support
The ExtendedMove class can optionally replace the standard Move class to allow the passing of absolute position and rotation information from the client's input device to the server. It is enabled by changing $TORQUE_EXTENDED_MOVE to true in buildFiles/config/project.conf and re-running the project generator.
This commit is contained in:
parent
404cffc11a
commit
35374f939e
15 changed files with 1262 additions and 27 deletions
51
Engine/source/T3D/gameBase/extended/extendedMove.h
Normal file
51
Engine/source/T3D/gameBase/extended/extendedMove.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef _EXTENDEDMOVE_H_
|
||||
#define _EXTENDEDMOVE_H_
|
||||
|
||||
#include "T3D/gameBase/moveManager.h"
|
||||
#include "math/mQuat.h"
|
||||
|
||||
struct ExtendedMove : public Move
|
||||
{
|
||||
typedef Move Parent;
|
||||
|
||||
enum Constants {
|
||||
MaxPositionsRotations = 2,
|
||||
|
||||
MaxPositionBits = 13,
|
||||
MaxRotationBits = 11,
|
||||
};
|
||||
|
||||
// Position is in millimeters
|
||||
S32 posX[MaxPositionsRotations], posY[MaxPositionsRotations], posZ[MaxPositionsRotations];
|
||||
|
||||
F32 rotX[MaxPositionsRotations], rotY[MaxPositionsRotations], rotZ[MaxPositionsRotations], rotW[MaxPositionsRotations];
|
||||
|
||||
// Network clamped rotation
|
||||
S32 crotX[MaxPositionsRotations], crotY[MaxPositionsRotations], crotZ[MaxPositionsRotations], crotW[MaxPositionsRotations];
|
||||
|
||||
ExtendedMove();
|
||||
|
||||
virtual void pack(BitStream *stream, const Move * move = NULL);
|
||||
virtual void unpack(BitStream *stream, const Move * move = NULL);
|
||||
|
||||
virtual void clamp();
|
||||
virtual void unclamp();
|
||||
};
|
||||
|
||||
extern const ExtendedMove NullExtendedMove;
|
||||
|
||||
class ExtendedMoveManager
|
||||
{
|
||||
public:
|
||||
static S32 mPosX[ExtendedMove::MaxPositionsRotations];
|
||||
static S32 mPosY[ExtendedMove::MaxPositionsRotations];
|
||||
static S32 mPosZ[ExtendedMove::MaxPositionsRotations];
|
||||
static F32 mRotAX[ExtendedMove::MaxPositionsRotations];
|
||||
static F32 mRotAY[ExtendedMove::MaxPositionsRotations];
|
||||
static F32 mRotAZ[ExtendedMove::MaxPositionsRotations];
|
||||
static F32 mRotAA[ExtendedMove::MaxPositionsRotations];
|
||||
|
||||
static void init();
|
||||
};
|
||||
|
||||
#endif // _EXTENDEDMOVE_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue