--- ray/src/common/mesh.h 2003/06/20 00:25:49 2.6 +++ ray/src/common/mesh.h 2003/09/18 16:53:53 2.11 @@ -1,4 +1,4 @@ -/* RCSid $Id: mesh.h,v 2.6 2003/06/20 00:25:49 greg Exp $ */ +/* RCSid $Id: mesh.h,v 2.11 2003/09/18 16:53:53 greg Exp $ */ /* * Header for compact triangle mesh geometry * @@ -6,14 +6,13 @@ */ #ifndef _RAD_MESH_H_ #define _RAD_MESH_H_ + +#include "lookup.h" + #ifdef __cplusplus extern "C" { #endif -#include "copyright.h" - -#include "lookup.h" - #ifndef BYTE #define BYTE unsigned char #endif @@ -51,7 +50,7 @@ extern "C" { typedef struct { uint32 (*xyz)[3]; /* up to 256 patch vertices */ int32 *norm; /* vertex normals */ - uint32 (*uv)[2]; /* vertex local coordinates */ + uint16 (*uv)[2]; /* vertex local coordinates */ struct PTri { BYTE v1, v2, v3; /* local vertices */ } *tri; /* local triangles */ @@ -68,7 +67,7 @@ typedef struct { BYTE v3; /* local vertex */ } *j2tri; /* double joiner triangles */ short nverts; /* vertex count */ - short ntris; /* triangle count */ + short ntris; /* local triangle count */ short nj1tris; /* joiner triangle count */ short nj2tris; /* double joiner triangle count */ } MESHPATCH; @@ -79,7 +78,7 @@ typedef struct mesh { int nref; /* reference count */ int ldflags; /* what we've loaded */ CUBE mcube; /* bounds and octree */ - FLOAT uvlim[2][2]; /* local coordinate extrema */ + RREAL uvlim[2][2]; /* local coordinate extrema */ OBJECT mat0; /* base material index */ OBJECT nmats; /* number of materials */ MESHPATCH *patch; /* mesh patch list */ @@ -106,13 +105,13 @@ typedef struct { int fl; /* setting flags */ FVECT v; /* vertex location */ FVECT n; /* vertex normal */ - FLOAT uv[2]; /* local coordinates */ + RREAL uv[2]; /* local coordinates */ } MESHVERT; /* mesh format identifier */ #define MESHFMT "Radiance_tmesh" /* magic number for mesh files */ -#define MESHMAGIC ( 1 *MAXOBJSIZ+311) /* increment first value */ +#define MESHMAGIC ( 2 *MAXOBJSIZ+311) /* increment first value */ extern MESH *getmesh(char *mname, int flags);