doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Model_ma.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef __MODEL_MA_H__
30 #define __MODEL_MA_H__
31 
32 /*
33 ===============================================================================
34 
35  MA loader. (Maya Ascii Format)
36 
37 ===============================================================================
38 */
39 
40 typedef struct {
41  char name[128];
42  char parent[128];
44 
45 typedef struct {
46  char name[128];
47  int size;
49 
50 typedef struct maTransform_s {
56 
57 typedef struct {
58  int edge[3];
59  int vertexNum[3];
60  int tVertexNum[3];
61  int vertexColors[3];
62  idVec3 vertexNormals[3];
63 } maFace_t;
64 
65 typedef struct {
66 
67  //Transform to be applied
69 
70  //Verts
76 
77  //Texture Coordinates
80 
81  //Edges
82  int numEdges;
84 
85  //Colors
86  int numColors;
88 
89  //Faces
90  int numFaces;
92 
93  //Normals
98 
99 } maMesh_t;
100 
101 typedef struct {
102  char name[128];
103  float uOffset, vOffset; // max lets you offset by material without changing texCoords
104  float uTiling, vTiling; // multiply tex coords by this
105  float angle; // in clockwise radians
106 } maMaterial_t;
107 
108 typedef struct {
109  char name[128];
111  char materialName[128];
112 
114 } maObject_t;
115 
116 
117 typedef struct {
118  char name[128];
119  char path[1024];
120 } maFileNode_t;
121 
122 typedef struct maMaterialNode_s {
123  char name[128];
124 
127 
129 
130 typedef struct maModel_s {
131  ID_TIME_T timeStamp;
135 
136  //Material Resolution
139 
140 } maModel_t;
141 
142 maModel_t *MA_Load( const char *fileName );
143 void MA_Free( maModel_t *ma );
144 
145 #endif /* !__MODEL_MA_H__ */
maTransform_s * parent
Definition: Model_ma.h:54
void MA_Free(maModel_t *ma)
Definition: Model_ma.cpp:1039
struct maMaterialNode_s maMaterialNode_t
maFace_t * faces
Definition: Model_ma.h:91
float vOffset
Definition: Model_ma.h:103
maTransform_t * transform
Definition: Model_ma.h:68
idVec3 * edges
Definition: Model_ma.h:83
idHashTable< maMaterialNode_t * > materialNodes
Definition: Model_ma.h:138
int numNormals
Definition: Model_ma.h:94
Definition: Vector.h:316
idVec2 * tvertexes
Definition: Model_ma.h:79
int numColors
Definition: Model_ma.h:86
struct maModel_s maModel_t
int nextVertTransformIndex
Definition: Model_ma.h:75
int numFaces
Definition: Model_ma.h:90
float angle
Definition: Model_ma.h:105
idList< maObject_t * > objects
Definition: Model_ma.h:133
maMesh_t mesh
Definition: Model_ma.h:113
idVec3 rotate
Definition: Model_ma.h:52
bool normalsParsed
Definition: Model_ma.h:96
Definition: Vector.h:52
idVec3 * normals
Definition: Model_ma.h:95
Definition: Vector.h:808
idVec4 * vertTransforms
Definition: Model_ma.h:74
maFileNode_t * file
Definition: Model_ma.h:126
struct maTransform_s maTransform_t
float vTiling
Definition: Model_ma.h:104
byte * colors
Definition: Model_ma.h:87
const char * path
Definition: sws.c:117
maMaterialNode_s * child
Definition: Model_ma.h:125
ID_TIME_T timeStamp
Definition: Model_ma.h:131
idHashTable< maTransform_t * > transforms
Definition: Model_ma.h:134
idVec3 translate
Definition: Model_ma.h:51
idList< maMaterial_t * > materials
Definition: Model_ma.h:132
int numTVertexes
Definition: Model_ma.h:78
int numVertTransforms
Definition: Model_ma.h:73
maModel_t * MA_Load(const char *fileName)
Definition: Model_ma.cpp:1008
int numEdges
Definition: Model_ma.h:82
unsigned char byte
Definition: Lib.h:75
const GLcharARB * name
Definition: glext.h:3629
int nextNormal
Definition: Model_ma.h:97
idHashTable< maFileNode_t * > fileNodes
Definition: Model_ma.h:137
idVec3 scale
Definition: Model_ma.h:53
int numVertexes
Definition: Model_ma.h:71
int materialRef
Definition: Model_ma.h:110
idVec3 * vertexes
Definition: Model_ma.h:72