mirror of https://github.com/bjornbytes/lovr.git
Fix circle uvs;
After changing circle scale from diameter to radius, the uvs broke, since they are calculated from the position.
This commit is contained in:
parent
fe08dc3769
commit
0a2f968850
|
@ -1062,7 +1062,7 @@ void lovrGraphicsArc(DrawStyle style, ArcMode mode, Material* material, mat4 tra
|
||||||
for (int i = 0; i <= segments; i++) {
|
for (int i = 0; i <= segments; i++) {
|
||||||
float x = cosf(theta);
|
float x = cosf(theta);
|
||||||
float y = sinf(theta);
|
float y = sinf(theta);
|
||||||
memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, x + .5f, 1.f - (y + .5f) }), 8 * sizeof(float));
|
memcpy(vertices, ((float[]) { x, y, 0.f, 0.f, 0.f, 1.f, (1.f + x) * .5f, (1.f - y) * .5f }), 8 * sizeof(float));
|
||||||
vertices += 8;
|
vertices += 8;
|
||||||
theta += angleShift;
|
theta += angleShift;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue