Skip to content

Commit

Permalink
Merge pull request #21 from xdedss/xzq_ray
Browse files Browse the repository at this point in the history
修正视角移动
  • Loading branch information
asxzq authored Jul 13, 2021
2 parents 84569e4 + 49e941b commit 2fe7249
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ void Widget::fixedUpdate() {
glm::vec3 y = glm::normalize(camRot * glm::vec3(0.0f, 1.0f, 0.0f));
if (wheeldelta) {//滚轮、鼠标控制
camTarget -= 0.002f * (float)wheeldelta * z;
camTarget += -0.02f * (mousex - (int)screenWidth / 2) * ((float)exp(0.001 * wheeldelta)-1)* (float)(log10(1 + 0.3*distance)+0.1*distance) * x ;
camTarget += 0.02f * (mousey - (int)screenHeight/2) * ((float)exp(0.001 * wheeldelta)-1) * (float)(log10(1 + 0.3*distance)+0.1*distance) * y;
camTarget += 0.02f * (mousex - (int)screenWidth / 2) * ((float)exp(0.001 * wheeldelta)-1)* (float)(log10(1 + 0.3*distance)+0.1*distance) * x ;
camTarget -= 0.02f * (mousey - (int)screenHeight/2) * ((float)exp(0.001 * wheeldelta)-1) * (float)(log10(1 + 0.3*distance)+0.1*distance) * y;
wheeldelta = 0.0f;
}
else {//wasd控制
Expand Down

0 comments on commit 2fe7249

Please sign in to comment.