2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class Direction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static const int UNDEFINED = -1;
|
2026-03-03 03:04:10 +08:00
|
|
|
static const int SOUTH = 0;
|
|
|
|
|
static const int WEST = 1;
|
|
|
|
|
static const int NORTH = 2;
|
|
|
|
|
static const int EAST = 3;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
static const int STEP_X[];
|
|
|
|
|
static const int STEP_Z[];
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
static const wstring NAMES[];;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
// for [direction] it gives [tile-face]
|
|
|
|
|
static int DIRECTION_FACING[];
|
|
|
|
|
|
|
|
|
|
// for [facing] it gives [direction]
|
2026-03-01 12:16:08 +08:00
|
|
|
static int FACING_DIRECTION[];
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
// for [direction] it gives [opposite direction]
|
|
|
|
|
static int DIRECTION_OPPOSITE[];
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
// for [direction] it gives [90 degrees clockwise direction]
|
2026-03-01 12:16:08 +08:00
|
|
|
static int DIRECTION_CLOCKWISE[];
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
// for [direction] it gives [90 degrees counter-clockwise direction]
|
2026-03-01 12:16:08 +08:00
|
|
|
static int DIRECTION_COUNTER_CLOCKWISE[];
|
|
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
// for [direction][world-facing] it gives [tile-facing]
|
|
|
|
|
static int RELATIVE_DIRECTION_FACING[4][6];
|
|
|
|
|
|
|
|
|
|
static int getDirection(double xd, double zd);
|
|
|
|
|
static int getDirection(int x0, int z0, int x1, int z1);
|
2026-03-01 12:16:08 +08:00
|
|
|
};
|