File: vector.h

package info (click to toggle)
warzone2100 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,320 kB
  • sloc: cpp: 676,209; ansic: 391,201; javascript: 78,238; python: 16,632; php: 4,294; sh: 4,094; makefile: 2,629; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (41 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef TOOLS_MAP_WZCONFIG_H
#define TOOLS_MAP_WZCONFIG_H

struct Rotation;
struct Vector3i;
struct Vector2i
{
	Vector2i() {}
	Vector2i(int x, int y) : x(x), y(y) {}
	Vector2i(Vector3i const &r); // discards the z value

	int x, y;
};
struct Vector2f
{
	Vector2f() {}
	Vector2f(float x, float y) : x(x), y(y) {}
	Vector2f(Vector2i const &v) : x(v.x), y(v.y) {}

	float x, y;
};
struct Vector3i
{
	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
{
	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) {}

	float x, y, z;
};

#endif // #ifndef TOOLS_MAP_WZCONFIG_H