mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Optimized smooth lighting calculation code
This commit is contained in:
11
src/game.cpp
11
src/game.cpp
@@ -1229,6 +1229,17 @@ void the_game(
|
||||
s32 dx = input->getMousePos().X - displaycenter.X;
|
||||
s32 dy = input->getMousePos().Y - displaycenter.Y;
|
||||
//std::cout<<"window active, pos difference "<<dx<<","<<dy<<std::endl;
|
||||
|
||||
const float keyspeed = 500;
|
||||
if(input->isKeyDown(irr::KEY_UP))
|
||||
dy -= dtime * keyspeed;
|
||||
if(input->isKeyDown(irr::KEY_DOWN))
|
||||
dy += dtime * keyspeed;
|
||||
if(input->isKeyDown(irr::KEY_LEFT))
|
||||
dx -= dtime * keyspeed;
|
||||
if(input->isKeyDown(irr::KEY_RIGHT))
|
||||
dx += dtime * keyspeed;
|
||||
|
||||
camera_yaw -= dx*0.2;
|
||||
camera_pitch += dy*0.2;
|
||||
if(camera_pitch < -89.5) camera_pitch = -89.5;
|
||||
|
Reference in New Issue
Block a user