Make ready rotation implementation
This commit is contained in:
+5
-1
@@ -16,8 +16,9 @@ mod support;
|
|||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
struct PerInstance {
|
struct PerInstance {
|
||||||
pub w_position: (f32, f32, f32),
|
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_NUMBER: usize = 19;
|
||||||
const BIOMES: [&str; BIOMES_NUMBER] = [
|
const BIOMES: [&str; BIOMES_NUMBER] = [
|
||||||
@@ -195,6 +196,7 @@ fn main() {
|
|||||||
uniform mat4 view_matrix;
|
uniform mat4 view_matrix;
|
||||||
|
|
||||||
in vec3 w_position;
|
in vec3 w_position;
|
||||||
|
in float w_rotation;
|
||||||
in vec3 position;
|
in vec3 position;
|
||||||
in vec2 texture;
|
in vec2 texture;
|
||||||
out vec2 v_texture;
|
out vec2 v_texture;
|
||||||
@@ -224,9 +226,11 @@ fn main() {
|
|||||||
let per_instance = vec![
|
let per_instance = vec![
|
||||||
PerInstance {
|
PerInstance {
|
||||||
w_position: (0.0, 0.0, 0.0),
|
w_position: (0.0, 0.0, 0.0),
|
||||||
|
w_rotation: 0.0,
|
||||||
},
|
},
|
||||||
PerInstance {
|
PerInstance {
|
||||||
w_position: (1.0, 0.0, 0.0),
|
w_position: (1.0, 0.0, 0.0),
|
||||||
|
w_rotation: 0.0,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user