View Single Post
Re: v.absmin and v.absmax
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: v.absmin and v.absmax - 13-01-2004

I was wrong in this discussion, worldspawn is not bindable as an entity. You can't do INDEXENT (0), it will give you an invalid edict pointer.

In order to know the map's bounding box, you have to read the BSP file and extract it yourself. It's simple :
Code:
   // load the bsp file and get its actual size (can't fail to do this, the map already booted)
   sprintf (bsp_file_path, "maps/%s.bsp", STRING (gpGlobals->mapname)); // build BSP file path
   mfile = (char *) LOAD_FILE_FOR_ME (bsp_file_path, &bsp_file_size); // load bsp file
 
   // read the MODELS lump of the BSP file
   memcpy (bsp_file.dmodels, mfile + ((dheader_t *) mfile)->lumps[LUMP_MODELS].fileofs, ((dheader_t *) mfile)->lumps[LUMP_MODELS].filelen);

   FREE_FILE (mfile); // everything is loaded, free the BSP file
 
   // get access to the world's bounding box
   v_worldmins = bsp_file.dmodels[0].mins;
   v_worldmaxs = bsp_file.dmodels[0].maxs;
Look in the racc.h file of my bot source code for the right #define's and struct stuff.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote