implement mirror mode using rotation vector
This commit is contained in:
parent
ec6165214b
commit
f637c86529
|
@ -218,7 +218,7 @@
|
|||
"text scale": 0.71,
|
||||
"text foreground": [200.0, 200.0, 200.0, 255.0],
|
||||
"text background": [60.0, 60.0, 60.0, 190.0],
|
||||
"start text": "✶ PLAY ✶",
|
||||
"start text": "✶✶ PLAY ✶✶",
|
||||
"start translation": [0.0, -0.4],
|
||||
"start alt texture": "resource/press_button_to_start.png",
|
||||
"start alt translation": [0.0, -0.5],
|
||||
|
|
|
@ -1887,8 +1887,15 @@ void Cakefoot::update(float timestamp)
|
|||
}
|
||||
projection = glm::perspective(fov, window_box().aspect(), 0.1f, 100.0f);
|
||||
|
||||
/* Rotate X 180 if mirror mode is active */
|
||||
float rotation_x = rotation.x;
|
||||
if (view_index == 1)
|
||||
{
|
||||
rotation_x += glm::pi<float>();
|
||||
}
|
||||
|
||||
/* Transformation that applies the rotation state of the entire scene */
|
||||
glm::mat4 rotation_matrix = glm::rotate(glm::mat4(1), rotation.x, {0.0f, 1.0f, 0.0f}) * glm::rotate(glm::mat4(1), rotation.y, {1.0f, 0.0f, 0.0f});
|
||||
glm::mat4 rotation_matrix = glm::rotate(glm::mat4(1), rotation_x, {0.0f, 1.0f, 0.0f}) * glm::rotate(glm::mat4(1), rotation.y, {1.0f, 0.0f, 0.0f});
|
||||
|
||||
/* Clear screen to configured color */
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
|
Loading…
Reference in New Issue