Files
dusk/src/dusk/overworld/facingdir.h
T
2026-06-07 21:27:59 -05:00

29 lines
661 B
C

/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef enum {
FACING_DIR_DOWN = 0,
FACING_DIR_UP = 1,
FACING_DIR_LEFT = 2,
FACING_DIR_RIGHT = 3,
FACING_DIR_SOUTH = FACING_DIR_DOWN,
FACING_DIR_NORTH = FACING_DIR_UP,
FACING_DIR_WEST = FACING_DIR_LEFT,
FACING_DIR_EAST = FACING_DIR_RIGHT,
} facingdir_t;
/**
* Converts a facing direction to a normalized XZ vec2.
*
* @param facing The facing direction.
* @param dest Output vec2 - [0] is X, [1] is Z.
*/
void facingDirToVec2(facingdir_t facing, vec2 dest);