1 /* This program is free software; you can redistribute it and/or modify 2 * it under the terms of version 3 or later of the GNU General Public License as 3 * published by the Free Software Foundation. 4 * 5 * This program is distributed in the hope that it will be useful, 6 * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8 * GNU General Public License for more details. 9 * 10 * You should have received a copy of the GNU General Public License 11 * along with this program; if not, write to the Free Software 12 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 13 14 #ifndef MODEL_H 15 #define MODEL_H 16 17 /* Occulsion model */ 18 typedef struct _OccModel { 19 GArray *planes; 20 GArray *edges; 21 GArray *points; 22 } OccModel; 23 24 typedef struct Occluder_T { 25 float invMat[4][4]; 26 float trans[3]; 27 float rot[3]; 28 int rotator; 29 30 GLuint shadow_list; 31 OccModel *handle; 32 int show; 33 } Occluder; 34 35 extern void GenerateShadowVolume(const Occluder * pOcc, const float olight[4]); 36 37 extern void initOccluder(Occluder * pOcc); 38 extern void freeOccluder(Occluder * pOcc); 39 extern void copyOccluder(const Occluder * fromOcc, Occluder * toOcc); 40 extern void moveToOcc(const Occluder * pOcc); 41 42 extern void addClosedSquare(Occluder * pOcc, float x, float y, float z, float w, float h, float d); 43 extern void addSquare(Occluder * pOcc, float x, float y, float z, float w, float h, float d); 44 extern void addSquareCentered(Occluder * pOcc, float x, float y, float z, float w, float h, float d); 45 extern void addCube(Occluder * pOcc, float x, float y, float z, float w, float h, float d); 46 extern void addWonkyCube(Occluder * pOcc, float x, float y, float z, float w, float h, float d, float s, int full); 47 extern void addCylinder(Occluder * pOcc, float x, float y, float z, float r, float d, unsigned int numSteps); 48 extern void addHalfTube(Occluder * pOcc, float r, float h, unsigned int numSteps); 49 extern void addDice(Occluder * pOcc, float size); 50 51 extern void draw_shadow_volume_extruded_edges(Occluder * pOcc, const float light_position[4], unsigned int prim); 52 53 #endif 54