This repository has been archived on 2022-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
ludum-dare-50/game/game_logic/src/coord_convert.rs

11 lines
376 B
Rust

use nalgebra as na;
/// Converts from the tiled coordinate system to the game coordinate system.
pub fn tiled_to_game(vec: na::Vector2<f32>) -> na::Vector2<f32> {
na::Vector2::new(vec.x, vec.y * -1.0)
}
/// Converts from the game coordinate system to the tiled coordinate system.
pub fn game_to_tiled(vec: na::Vector2<f32>) -> na::Vector2<f32> {
tiled_to_game(vec)
}