1 /* 2 Copyright (C) 2003 Cedric Cellier, Dominique Lavault 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 #ifndef GEOM_H 19 #define GEOM_H 20 21 #include <math.h> 22 #include "opengl.h" 23 #include "csg.h" 24 #include "data.h" 25 26 struct Point2D { GLdouble x, y; }; 27 struct face { unsigned idxP0,idxP1,idxP2; }; 28 29 extern void geom_b_box_union(b_box *, b_box *, b_box *); 30 extern void geom_b_box_intersection(b_box *, b_box *, b_box *); 31 extern void geom_get_b_box(csg_node *, b_box *); 32 extern void geom_get_b_box_2d(b_box *, b_box_2d *); 33 extern int geom_b_box_intersects(b_box *, b_box *); 34 extern void geom_set_current_modelview(GLfloat*); 35 extern void geom_set_current_projection(GLfloat*); 36 37 extern void geom_rapproche(GLfloat *, GLfloat *, float); 38 extern float geom_scalaire(GLfloat *, GLfloat *); 39 extern float geom_norme(GLfloat *); 40 extern void geom_normalise(GLfloat *); 41 extern void geom_orthogonalise(GLfloat *, GLfloat *); 42 extern void geom_vectoriel(GLfloat *, GLfloat *, GLfloat *); 43 extern void geom_position_approche(GLfloat *, GLfloat *, float); 44 extern int geom_get_3d(GLdouble, GLdouble, GLdouble, GLdouble *, GLdouble *, GLdouble *); 45 extern void geom_set_identity(GLfloat *); 46 extern void geom_matrix_mult(GLfloat *, GLfloat *, GLfloat *); 47 48 extern mesh *geom_clic_position(position *, GLfloat *); 49 extern int geom_pos_is_equivalent(mesh **, GLfloat (*)[16], unsigned); 50 51 #endif 52