diff options
Diffstat (limited to 'sdl/glframe.c')
-rw-r--r-- | sdl/glframe.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sdl/glframe.c b/sdl/glframe.c index fbf8cd6..16a91cb 100644 --- a/sdl/glframe.c +++ b/sdl/glframe.c @@ -2,8 +2,6 @@ * * Camera * - * notes: we could make these functions to be inlined, but they would need - * to be moved into a header * */ @@ -63,6 +61,18 @@ inline void glframe_get_camera_orientation(GLFrame *frame, M3DMatrix44f m) /* perform viewing or modeling transformations */ inline void glframe_apply_camera_transform(GLFrame *frame, const int rot_only) { + if (rot_only) + { + gluLookAt(frame->v_location[0], frame->v_location[1], frame->v_location[2], + frame->v_location[0] + frame->v_forward[0], + frame->v_location[1] + frame->v_forward[1], + frame->v_location[2] + frame->v_forward[2], + frame->v_up[0], frame->v_up[1], frame->v_up[2]); + + return; + } + + /* do it the hard way */ M3DMatrix44f m; glframe_get_camera_orientation(frame, m); glMultMatrixf(m); @@ -70,14 +80,6 @@ inline void glframe_apply_camera_transform(GLFrame *frame, const int rot_only) if (!rot_only) glTranslatef(-frame->v_location[0], -frame->v_location[1], -frame->v_location[2]); - -#if 0 - gluLookAt(frame->v_location[0], frame->v_location[1], frame->v_location[2], - frame->v_location[0] + frame->v_forward[0], - frame->v_location[1] + frame->v_forward[1], - frame->v_location[2] + frame->v_forward[2], - frame->v_up[0], frame->v_up[1], frame->v_up[2]); -#endif } inline void glframe_move_forward(GLFrame *frame, const float delta) |