mirror of https://github.com/bjornbytes/lovr.git
Fix double/float conversions;
This commit is contained in:
parent
8ee7a7c9a3
commit
b8ed63fcc4
|
@ -229,8 +229,8 @@ void lovrGraphicsSetCamera(Camera* camera, bool clear) {
|
|||
memset(&state.camera, 0, sizeof(Camera));
|
||||
mat4_identity(state.camera.viewMatrix[0]);
|
||||
mat4_identity(state.camera.viewMatrix[1]);
|
||||
mat4_perspective(state.camera.projection[0], .01f, 100.f, 67.f * M_PI / 180.f, (float) state.width / state.height);
|
||||
mat4_perspective(state.camera.projection[1], .01f, 100.f, 67.f * M_PI / 180.f, (float) state.width / state.height);
|
||||
mat4_perspective(state.camera.projection[0], .01f, 100.f, 67.f * (float) M_PI / 180.f, (float) state.width / state.height);
|
||||
mat4_perspective(state.camera.projection[1], .01f, 100.f, 67.f * (float) M_PI / 180.f, (float) state.width / state.height);
|
||||
} else {
|
||||
state.camera = *camera;
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ void lovrGraphicsArc(DrawStyle style, ArcMode mode, Material* material, mat4 tra
|
|||
}
|
||||
|
||||
void lovrGraphicsCircle(DrawStyle style, Material* material, mat4 transform, int segments) {
|
||||
lovrGraphicsArc(style, ARC_MODE_OPEN, material, transform, 0, 2. * M_PI, segments);
|
||||
lovrGraphicsArc(style, ARC_MODE_OPEN, material, transform, 0, 2.f * (float) M_PI, segments);
|
||||
}
|
||||
|
||||
void lovrGraphicsCylinder(Material* material, mat4 transform, float r1, float r2, bool capped, int segments) {
|
||||
|
|
|
@ -138,7 +138,7 @@ static void desktop_renderTo(void (*callback)(void*), void* userdata) {
|
|||
uint32_t width, height;
|
||||
desktop_getDisplayDimensions(&width, &height);
|
||||
Camera camera = { .canvas = NULL, .viewMatrix = { MAT4_IDENTITY }, .stereo = true };
|
||||
mat4_perspective(camera.projection[0], state.clipNear, state.clipFar, 67.f * M_PI / 180.f, (float) width / 2.f / height);
|
||||
mat4_perspective(camera.projection[0], state.clipNear, state.clipFar, 67.f * (float) M_PI / 180.f, (float) width / 2.f / height);
|
||||
mat4_multiply(camera.viewMatrix[0], state.transform);
|
||||
mat4_invertPose(camera.viewMatrix[0]);
|
||||
mat4_set(camera.projection[1], camera.projection[0]);
|
||||
|
|
|
@ -232,7 +232,7 @@ quat quat_between(quat q, vec3 u, vec3 v) {
|
|||
vec3_cross(vec3_set(axis, 0.f, 1.f, 0.f), u);
|
||||
}
|
||||
vec3_normalize(axis);
|
||||
quat_fromAngleAxis(q, M_PI, axis[0], axis[1], axis[2]);
|
||||
quat_fromAngleAxis(q, (float) M_PI, axis[0], axis[1], axis[2]);
|
||||
return q;
|
||||
}
|
||||
vec3_cross(vec3_init(q, u), v);
|
||||
|
|
Loading…
Reference in New Issue