forked from aya/aya
42 lines
1005 B
C++
42 lines
1005 B
C++
#pragma once
|
|
|
|
#include "Utility/G3DCore.hpp"
|
|
|
|
|
|
namespace RakNet
|
|
{
|
|
class BitStream;
|
|
}
|
|
|
|
namespace Aya
|
|
{
|
|
|
|
namespace Network
|
|
{
|
|
|
|
class Compressor
|
|
{
|
|
public:
|
|
typedef enum
|
|
{
|
|
UNCOMPRESSED = 0,
|
|
RAKNET_COMPRESSED,
|
|
HEAVILY_COMPRESSED
|
|
} CompressionType;
|
|
|
|
private:
|
|
static bool canHeavilyCompressTranslation(const Vector3& translation);
|
|
|
|
static void writeCompressionType(RakNet::BitStream& bitStream, CompressionType compressionType);
|
|
static CompressionType readCompressionType(RakNet::BitStream& bitStream);
|
|
|
|
public:
|
|
static void writeTranslation(RakNet::BitStream& bitStream, const Vector3& translation, CompressionType compressionType);
|
|
static void writeRotation(RakNet::BitStream& bitStream, const Matrix3& rotation, CompressionType compressionType);
|
|
|
|
static void readTranslation(RakNet::BitStream& bitStream, Vector3& translation);
|
|
static void readRotation(RakNet::BitStream& bitStream, Matrix3& rotation);
|
|
};
|
|
|
|
} // namespace Network
|
|
} // namespace Aya
|