Add a rendering system using temporary images #61

Merged
CoCo_Sol merged 26 commits from renderer into main 2024-03-05 18:08:56 +00:00
Showing only changes of commit ef6f553133 - Show all commits

View file

@ -27,7 +27,7 @@ struct TilesGap(Vec2);
struct TilesSize(Vec2); struct TilesSize(Vec2);
impl Tile { impl Tile {
/// Returns the texture handle of the tile. /// Returns the handle of the image of the tile.
fn get_texture(&self, asset_server: &AssetServer) -> Handle<Image> { fn get_texture(&self, asset_server: &AssetServer) -> Handle<Image> {
match self { match self {
Self::Grass => asset_server.load("tiles/grass.png"), Self::Grass => asset_server.load("tiles/grass.png"),
@ -95,7 +95,7 @@ fn render_map(
} }
} }
/// A simple sigmoid function to convert from y to z position. /// A simple sigmoid function to convert y position to z position.
/// The return value is between 0 and 1. /// The return value is between 0 and 1.
fn z_position_from_y(y: f32) -> f32 { fn z_position_from_y(y: f32) -> f32 {
-1.0 / (1.0 + (-y * 110_f64.powi(-5) as f32).exp()) -1.0 / (1.0 + (-y * 110_f64.powi(-5) as f32).exp())