Merge branch 'dev' into generated-pcm-stream
This commit is contained in:
@@ -207,8 +207,7 @@ void CameraControl::update(
|
||||
tpCamera->front = camera->front;
|
||||
tpCamera->right = camera->right;
|
||||
}
|
||||
if (player.currentCamera == spCamera || player.currentCamera == tpCamera ||
|
||||
player.currentCamera == camera) {
|
||||
if (player.isCurrentCameraBuiltin()) {
|
||||
player.currentCamera->setFov(glm::radians(settings.fov.get()));
|
||||
}
|
||||
}
|
||||
@@ -280,7 +279,7 @@ void PlayerController::postUpdate(
|
||||
updateFootsteps(delta);
|
||||
}
|
||||
|
||||
if (!pause && input) {
|
||||
if (!pause && input && player.isCurrentCameraBuiltin()) {
|
||||
camControl.updateMouse(this->input, windowHeight);
|
||||
}
|
||||
camControl.refreshRotation();
|
||||
|
||||
@@ -82,6 +82,12 @@ static int l_get_mouse_pos(lua::State* L) {
|
||||
return lua::pushvec2(L, engine->getInput().getCursor().pos);
|
||||
}
|
||||
|
||||
static int l_get_mouse_delta(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
return lua::pushvec2(L, engine->getInput().getCursor().delta);
|
||||
}
|
||||
|
||||
static int l_get_bindings(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
@@ -171,6 +177,7 @@ const luaL_Reg inputlib[] = {
|
||||
{"mousecode", lua::wrap<l_mousecode>},
|
||||
{"add_callback", lua::wrap<l_add_callback>},
|
||||
{"get_mouse_pos", lua::wrap<l_get_mouse_pos>},
|
||||
{"get_mouse_delta", lua::wrap<l_get_mouse_delta>},
|
||||
{"get_bindings", lua::wrap<l_get_bindings>},
|
||||
{"get_binding_text", lua::wrap<l_get_binding_text>},
|
||||
{"is_active", lua::wrap<l_is_active>},
|
||||
|
||||
Reference in New Issue
Block a user