#include <model.h>
Model::Model |
( |
std::string & |
filename | ) |
|
Vec3D * vertices
Definition: model.h:43
ModelHeader header
Definition: model.h:42
std::string filename
Definition: model.h:40
uint16 * indices
Definition: model.h:44
void _unload()
Definition: model.h:33
arena_t NULL
Definition: jemalloc_internal.h:624
Vec3D * vertices
Definition: model.h:43
uint16 * indices
Definition: model.h:44
bool Model::ConvertToVMAPModel |
( |
char const * |
outfilename | ) |
|
74 int N[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
75 FILE*
output=fopen(outfilename,
"wb");
78 printf(
"Can't create the output file '%s'\n",outfilename);
83 fwrite(&nVertices,
sizeof(
int), 1, output);
85 fwrite(&nofgroups,
sizeof(
uint32), 1, output);
86 fwrite(N,4*3,1,output);
87 fwrite(N,
sizeof(
float),3*2,output);
89 fwrite(
"GRP ",4,1,output);
92 wsize =
sizeof(branches) +
sizeof(
uint32) * branches;
93 fwrite(&wsize,
sizeof(
int), 1, output);
94 fwrite(&branches,
sizeof(branches), 1, output);
96 fwrite(&nIndexes,
sizeof(
uint32), 1, output);
97 fwrite(
"INDX",4, 1, output);
98 wsize =
sizeof(
uint32) +
sizeof(
unsigned short) * nIndexes;
99 fwrite(&wsize,
sizeof(
int), 1, output);
100 fwrite(&nIndexes,
sizeof(
uint32), 1, output);
103 for (
uint32 i = 0; i < nIndexes; ++i)
105 if ((i % 3) - 1 == 0 && i + 1 < nIndexes)
112 fwrite(
indices,
sizeof(
unsigned short), nIndexes, output);
115 fwrite(
"VERT", 4, 1, output);
116 wsize =
sizeof(int) +
sizeof(
float) * 3 * nVertices;
117 fwrite(&wsize,
sizeof(
int), 1, output);
118 fwrite(&nVertices,
sizeof(
int), 1, output);
121 for (
uint32 vpos = 0; vpos < nVertices; ++vpos)
128 fwrite(
vertices,
sizeof(
float)*3, nVertices, output);
const char * szRawVMAPMagic
Definition: vmapexport.cpp:82
Vec3D * vertices
Definition: model.h:43
ModelHeader header
Definition: model.h:42
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
uint16 * indices
Definition: model.h:44
float z
Definition: vec3d.h:28
float y
Definition: vec3d.h:28
uint32_t uint32
Definition: g3dmath.h:168
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083
HANDLE CascStorage
Definition: System.cpp:69
void close()
Definition: mpqfile.cpp:81
Vec3D * vertices
Definition: model.h:43
ModelHeader header
Definition: model.h:42
std::string filename
Definition: model.h:40
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
uint16 * indices
Definition: model.h:44
void _unload()
Definition: model.h:33
Vec3D fixCoordSystem(Vec3D v)
Definition: model.cpp:137
std::string Model::filename |
|
private |
The documentation for this class was generated from the following files: