polyset.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, 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. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. #ifndef __POLYSET_H__
  19. #define __POLYSET_H__
  20. #define POLYSET_MAXTRIANGLES 4096
  21. #define POLYSET_MAXPOLYSETS 64
  22. typedef float st_t[2];
  23. typedef float rgb_t[3];
  24. typedef struct {
  25. vec3_t verts[3];
  26. vec3_t normals[3];
  27. st_t texcoords[3];
  28. } triangle_t;
  29. typedef struct
  30. {
  31. char name[100];
  32. char materialname[100];
  33. triangle_t *triangles;
  34. int numtriangles;
  35. } polyset_t;
  36. polyset_t *Polyset_LoadSets( const char *file, int *numpolysets, int maxTrisPerSet );
  37. polyset_t *Polyset_CollapseSets( polyset_t *psets, int numpolysets );
  38. polyset_t *Polyset_SplitSets( polyset_t *psets, int numpolysets, int *pNumNewPolysets, int maxTris );
  39. void Polyset_SnapSets( polyset_t *psets, int numpolysets );
  40. void Polyset_ComputeNormals( polyset_t *psets, int numpolysets );
  41. #endif