forked from Kolyah35/minecraft-pe-0.6.1
the whole game
This commit is contained in:
36
src/world/PosTranslator.h
Executable file
36
src/world/PosTranslator.h
Executable file
@@ -0,0 +1,36 @@
|
||||
#ifndef NET_MINECRAFT_WORLD_PosTranslator_H__
|
||||
#define NET_MINECRAFT_WORLD_PosTranslator_H__
|
||||
|
||||
//package net.minecraft;
|
||||
|
||||
class IPosTranslator {
|
||||
public:
|
||||
virtual ~IPosTranslator() {}
|
||||
virtual void to(int& x, int& y, int& z) = 0;
|
||||
virtual void to(float& x, float& y, float& z) = 0;
|
||||
|
||||
virtual void from(int& x, int& y, int& z) = 0;
|
||||
virtual void from(float& x, float& y, float& z) = 0;
|
||||
};
|
||||
|
||||
class OffsetPosTranslator: public IPosTranslator {
|
||||
public:
|
||||
OffsetPosTranslator()
|
||||
: xo(0),
|
||||
yo(0),
|
||||
zo(0)
|
||||
{}
|
||||
OffsetPosTranslator(float xo, float yo, float zo)
|
||||
: xo(xo),
|
||||
yo(yo),
|
||||
zo(zo)
|
||||
{}
|
||||
void to (float& x, float& y, float& z) { x += xo; y += yo; z += zo; }
|
||||
void to (int& x, int& y, int& z) { x += (int)xo; y += (int)yo; z += (int)zo; }
|
||||
void from(float& x, float& y, float& z) { x -= xo; y -= yo; z -= zo; }
|
||||
void from(int& x, int& y, int& z) { x -= (int)xo; y -= (int)yo; z -= (int)zo; }
|
||||
|
||||
float xo, yo, zo;
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_WORLD_PosTranslator_H__*/
|
||||
Reference in New Issue
Block a user