prevent arbitrary wall climbing
parent
3916ff16da
commit
0052907432
|
@ -184,7 +184,7 @@ impl Graphics {
|
||||||
let world_model_mat = Mat4::IDENTITY;
|
let world_model_mat = Mat4::IDENTITY;
|
||||||
|
|
||||||
self.passes [0].with (gl_state, || {
|
self.passes [0].with (gl_state, || {
|
||||||
glezz::clear_color (0.5f32, 0.5f32, 0.5f32, 1.0f32);
|
glezz::clear_color (109f32 / 255.0, 194f32 / 255.0, 202f32 / 255.0, 1.0f32);
|
||||||
glezz::clear (gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT | gl::STENCIL_BUFFER_BIT);
|
glezz::clear (gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT | gl::STENCIL_BUFFER_BIT);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -192,6 +192,9 @@ impl Graphics {
|
||||||
let attrs = shader_vars.attrs;
|
let attrs = shader_vars.attrs;
|
||||||
let unis = shader_vars.unis;
|
let unis = shader_vars.unis;
|
||||||
|
|
||||||
|
glezz::uniform_3fv (unis [&u::ALBEDO], &white);
|
||||||
|
glezz::uniform_3fv (unis [&u::MIN_BRIGHT], &white);
|
||||||
|
|
||||||
if true {
|
if true {
|
||||||
self.texture_earth.bind ();
|
self.texture_earth.bind ();
|
||||||
|
|
||||||
|
@ -354,7 +357,7 @@ impl Graphics {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if true {
|
if false {
|
||||||
let sky_mvp_mat = view_mat * Mat4::from_scale ((64.0, 64.0, 64.0).into ());
|
let sky_mvp_mat = view_mat * Mat4::from_scale ((64.0, 64.0, 64.0).into ());
|
||||||
|
|
||||||
self.texture_sky.bind ();
|
self.texture_sky.bind ();
|
||||||
|
|
|
@ -150,7 +150,7 @@ async fn main () -> Result <()> {
|
||||||
let mut game_state = GameState::default ();
|
let mut game_state = GameState::default ();
|
||||||
let phys_params = opengl_rust::physics::Params {
|
let phys_params = opengl_rust::physics::Params {
|
||||||
dt: 1.0 / 60.0,
|
dt: 1.0 / 60.0,
|
||||||
gravity: (0.0, 0.0, -0.25).into (),
|
gravity: (0.0, 0.0, -0.5).into (),
|
||||||
margin: 0.00125,
|
margin: 0.00125,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -184,10 +184,15 @@ async fn main () -> Result <()> {
|
||||||
|
|
||||||
let kb_state = event_pump.keyboard_state ();
|
let kb_state = event_pump.keyboard_state ();
|
||||||
|
|
||||||
let player_speed = if player_jump_vec.is_some () {
|
let player_speed = if let Some (v) = player_jump_vec.as_ref () {
|
||||||
game_state.player.vel.x = 0.0;
|
if v.z > 0.5 {
|
||||||
game_state.player.vel.y = 0.0;
|
game_state.player.vel.x = 0.0;
|
||||||
player_speed
|
game_state.player.vel.y = 0.0;
|
||||||
|
player_speed
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
0.125
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
0.125
|
0.125
|
||||||
|
|
Loading…
Reference in New Issue