mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-30 02:48:14 +03:00
Merge pull request #342 from kichikuou/camera
3d: Fix camera yaw direction and rotation order
This commit is contained in:
+1
-1
@@ -752,7 +752,7 @@ bool RE_plugin_get_camera_z_vector(struct RE_plugin *plugin, vec3 out)
|
||||
glm_rad(plugin->camera.roll)
|
||||
};
|
||||
mat4 rot;
|
||||
glm_euler(euler, rot);
|
||||
glm_euler_yxz(euler, rot);
|
||||
glm_mat4_mulv3(rot, GLM_FORWARD, 0.f, out);
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ void RE_calc_view_matrix(struct RE_camera *camera, vec3 up, mat4 out)
|
||||
glm_rad(camera->roll)
|
||||
};
|
||||
mat4 rot;
|
||||
glm_euler(euler, rot);
|
||||
glm_euler_yxz(euler, rot);
|
||||
glm_mat4_mulv3(rot, front, 0.0, front);
|
||||
glm_look(camera->pos, front, up, out);
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,7 @@ static bool ReignEngine_SetCameraAngle(int plugin, float angle)
|
||||
struct RE_plugin *p = get_plugin(plugin);
|
||||
if (!p)
|
||||
return false;
|
||||
p->camera.yaw = -angle;
|
||||
p->camera.yaw = angle;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user