28 if ( vert->
xyz.x < oct->
min.
xyz.x )
return 0;
29 if ( vert->
xyz.x > oct->
max.
xyz.x )
return 0;
31 if ( vert->
xyz.y < oct->
min.
xyz.y )
return 0;
32 if ( vert->
xyz.y > oct->
max.
xyz.y )
return 0;
34 if ( vert->
xyz.z < oct->
min.
xyz.z)
return 0;
35 if ( vert->
xyz.z > oct->
max.
xyz.z)
return 0;
53 for (j=0; j<3; j++ ) {
81 for (j=0; j<3; j++ ) {
104 ubyte * normcount = p+20;
108 for (n = 0; n < nverts; n++) {
109 nnorms += normcount[
n];
116 for (n=0; n<nverts; n++ ) {
119 src += normcount[
n]+1;
140 if ( nv < 0 )
return;
144 if ( (pm->
version < 2003) && !just_count ) {
155 center_point.
xyz.x /= nv;
156 center_point.
xyz.y /= nv;
157 center_point.
xyz.z /= nv;
159 *
vp(p+20) = center_point;
201 if ( nv < 0 )
return;
203 verts = (
short *)(p+44);
205 if ( (pm->
version < 2003) && !just_count ) {
216 center_point.
xyz.x /= nv;
217 center_point.
xyz.y /= nv;
218 center_point.
xyz.z /= nv;
220 *
vp(p+20) = center_point;
247 int chunk_type, chunk_size;
252 while (chunk_type !=
OP_EOF) {
254 switch (chunk_type) {
261 int frontlist =
w(p+36);
262 int backlist =
w(p+40);
263 int prelist =
w(p+44);
264 int postlist =
w(p+48);
265 int onlist =
w(p+52);
276 mprintf((
"Bad chunk type %d, len=%d in model_octant_find_faces_sub\n", chunk_type, chunk_size ));
317 vec3d min, max, center;
325 for (i=0; i<8; i++ ) {
367 for (i=0; i<8; i++ ) {
396 if ( model_orient && model_pos ) {
405 vm_vec_avg( ¢er, &((*pm)->mins), &((*pm)->maxs ));
408 if ( rotpnt.
xyz.x > center.
xyz.x ) x = 1;
else x = 0;
409 if ( rotpnt.
xyz.y > center.
xyz.y ) y = 1;
else y = 0;
410 if ( rotpnt.
xyz.z > center.
xyz.z ) z = 1;
else z = 0;
412 i = ( (x<<2) | (y<<1) |
z );
436 if ( model_orient && model_pos ) {
448 if ( rotpnt.
xyz.x > center.
xyz.x ) x = 1;
else x = 0;
449 if ( rotpnt.
xyz.y > center.
xyz.y ) y = 1;
else y = 0;
450 if ( rotpnt.
xyz.z > center.
xyz.z ) z = 1;
else z = 0;
452 i = ( (x<<2) | (y<<1) |
z );
475 if ( model_orient && model_pos ) {
487 if ( rotpnt.
xyz.x > center.
xyz.x ) x = 1;
else x = 0;
488 if ( rotpnt.
xyz.y > center.
xyz.y ) y = 1;
else y = 0;
489 if ( rotpnt.
xyz.z > center.
xyz.z ) z = 1;
else z = 0;
491 i = (x<<2) | (y<<1) |
z;
int point_in_octant(polymodel *pm, model_octant *oct, vec3d *vert)
polymodel * model_get(int model_num)
void model_octant_find_shields(polymodel *pm, model_octant *oct)
int detail[MAX_MODEL_DETAIL_LEVELS]
struct vec3d::@225::@227 xyz
vec3d * vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m)
shield_tri ** shield_tris
int model_which_octant(vec3d *pnt, int model_num, matrix *model_orient, vec3d *model_pos, model_octant **oct)
void vm_vec_add2(vec3d *dest, const vec3d *src)
float vm_vec_dist(const vec3d *v0, const vec3d *v1)
void model_octant_find_faces(polymodel *pm, model_octant *oct)
GLint GLint GLint GLint GLint x
void model_octant_free(polymodel *pm)
void vm_vec_sub(vec3d *dest, const vec3d *src0, const vec3d *src1)
int model_which_octant_distant_many(vec3d *pnt, int model_num, matrix *model_orient, vec3d *model_pos, polymodel **pm, int *octs)
void model_allocate_interp_data(int n_verts, int n_norms, int n_list_verts=0)
vec3d * vm_vec_avg(vec3d *dest, const vec3d *src0, const vec3d *src1)
void moff_tmappoly(ubyte *p, polymodel *pm, model_octant *oct, int just_count)
void moff_defpoints(ubyte *p, int just_count)
void moff_flatpoly(ubyte *p, polymodel *pm, model_octant *oct, int just_count)
void model_octant_create(polymodel *pm)
int model_which_octant_distant(vec3d *pnt, int model_num, matrix *model_orient, vec3d *model_pos, model_octant **oct)
int model_octant_find_faces_sub(polymodel *pm, model_octant *oct, void *model_ptr, int just_count)