warzone2100/tools/map/vector.h

42 lines
909 B
C
Raw Normal View History

#ifndef TOOLS_MAP_WZCONFIG_H
#define TOOLS_MAP_WZCONFIG_H
struct Rotation;
struct Vector3i;
struct Vector2i
{
2011-07-27 16:35:41 -07:00
Vector2i() {}
Vector2i(int x, int y) : x(x), y(y) {}
Vector2i(Vector3i const &r); // discards the z value
2011-07-27 16:35:41 -07:00
int x, y;
};
struct Vector2f
{
2011-07-27 16:35:41 -07:00
Vector2f() {}
Vector2f(float x, float y) : x(x), y(y) {}
Vector2f(Vector2i const &v) : x(v.x), y(v.y) {}
2011-07-27 16:35:41 -07:00
float x, y;
};
struct Vector3i
{
2011-07-27 16:35:41 -07:00
Vector3i() {}
Vector3i(int x, int y, int z) : x(x), y(y), z(z) {}
Vector3i(Vector2i const &xy, int z) : x(xy.x), y(xy.y), z(z) {}
Vector3i(Rotation const &r);
int x, y, z;
};
struct Vector3f
{
2011-07-27 16:35:41 -07:00
Vector3f() {}
Vector3f(float x, float y, float z) : x(x), y(y), z(z) {}
Vector3f(Vector3i const &v) : x(v.x), y(v.y), z(v.z) {}
Vector3f(Vector3f const &v) : x(v.x), y(v.y), z(v.z) {}
Vector3f(Vector2f const &xy, float z) : x(xy.x), y(xy.y), z(z) {}
2011-07-27 16:35:41 -07:00
float x, y, z;
};
2011-07-27 16:35:41 -07:00
#endif // #ifndef TOOLS_MAP_WZCONFIG_H