summaryrefslogtreecommitdiff
path: root/src/mesa/main/matrix.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2004-05-10 18:16:03 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2004-05-10 18:16:03 +0000
commit352d4dbfb24c65f327759c00c7db7d30a9482e35 (patch)
treecabc4ec120d77e991ec7fcb3e21baa3b26b0c282 /src/mesa/main/matrix.c
parent39fe9a7fe38081d6f40c4bf388a132c583330912 (diff)
Add EXT_vertex_cull support to mesa
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r--src/mesa/main/matrix.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 19e8dc3a5a..1e6b9dd394 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 );
}