diff options
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r-- | src/mesa/main/matrix.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 19e8dc3a5a0..1e6b9dd3947 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -745,8 +745,16 @@ calculate_model_project_matrix( GLcontext *ctx ) */ void _mesa_update_modelview_project( GLcontext *ctx, GLuint new_state ) { - if (new_state & _NEW_MODELVIEW) + if (new_state & _NEW_MODELVIEW) { _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + + /* Bring cull position uptodate. + */ + TRANSFORM_POINT3( ctx->Transform.CullObjPos, + ctx->ModelviewMatrixStack.Top->inv, + ctx->Transform.CullEyePos ); + } + if (new_state & _NEW_PROJECTION) update_projection( ctx ); @@ -898,6 +906,9 @@ void _mesa_init_transform( GLcontext *ctx ) ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 ); } ctx->Transform.ClipPlanesEnabled = 0; + + ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 ); + ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 ); } |