From ed1e341e094c6e754a2ac11b5b7665e99e8db506 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Mon, 31 Oct 2022 21:45:36 +0100 Subject: [PATCH] Make ready rotation implementation --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5773299..6279ba2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,8 +16,9 @@ mod support; #[derive(Copy, Clone, Debug)] struct PerInstance { pub w_position: (f32, f32, f32), + pub w_rotation: f32, } -implement_vertex!(PerInstance, w_position); +implement_vertex!(PerInstance, w_position, w_rotation); const BIOMES_NUMBER: usize = 19; const BIOMES: [&str; BIOMES_NUMBER] = [ @@ -195,6 +196,7 @@ fn main() { uniform mat4 view_matrix; in vec3 w_position; + in float w_rotation; in vec3 position; in vec2 texture; out vec2 v_texture; @@ -224,9 +226,11 @@ fn main() { let per_instance = vec![ PerInstance { w_position: (0.0, 0.0, 0.0), + w_rotation: 0.0, }, PerInstance { w_position: (1.0, 0.0, 0.0), + w_rotation: 0.0, }, ];