|
|
|
|
@ -110,7 +110,19 @@ loadScene(RenderState* rs)
|
|
|
|
|
return initLights(rs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#include <glm/gtc/matrix_transform.hpp> |
|
|
|
|
void |
|
|
|
|
orbitPositionZ0(glm::vec4* pos, float angle) |
|
|
|
|
{ |
|
|
|
|
// get radius length
|
|
|
|
|
float r = sqrt(pow(abs(pos->x), 2) + pow(abs(pos->z), 2)); |
|
|
|
|
// get current angle about z axis
|
|
|
|
|
float a = atan2f(pos->z, pos->x); |
|
|
|
|
// apply increment
|
|
|
|
|
a += angle; |
|
|
|
|
// get new x/z components
|
|
|
|
|
pos->x = r * cos(a); |
|
|
|
|
pos->z = r * sin(a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
render_cb_pre(RenderState* rs) |
|
|
|
|
|