TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
VMAP::WModelAreaCallback Class Reference

Public Member Functions

 WModelAreaCallback (const std::vector< GroupModel > &vals, const Vector3 &down)
 
void operator() (const Vector3 &point, uint32 entry)
 

Public Attributes

std::vector< GroupModel >
::const_iterator 
prims
 
std::vector< GroupModel >
::const_iterator 
hit
 
float minVol
 
float zDist
 
Vector3 zVec
 

Constructor & Destructor Documentation

VMAP::WModelAreaCallback::WModelAreaCallback ( const std::vector< GroupModel > &  vals,
const Vector3 down 
)
inline
462  :
463  prims(vals.begin()), hit(vals.end()), minVol(G3D::finf()), zDist(G3D::finf()), zVec(down) { }
float finf()
Definition: g3dmath.cpp:71
std::vector< GroupModel >::const_iterator prims
Definition: WorldModel.cpp:464
float minVol
Definition: WorldModel.cpp:466
float zDist
Definition: WorldModel.cpp:467
std::vector< GroupModel >::const_iterator hit
Definition: WorldModel.cpp:465
Vector3 zVec
Definition: WorldModel.cpp:468

Member Function Documentation

void VMAP::WModelAreaCallback::operator() ( const Vector3 point,
uint32  entry 
)
inline
470  {
471  float group_Z;
472  //float pVol = prims[entry].GetBound().volume();
473  //if (pVol < minVol)
474  //{
475  /* if (prims[entry].iBound.contains(point)) */
476  if (prims[entry].IsInsideObject(point, zVec, group_Z))
477  {
478  //minVol = pVol;
479  //hit = prims + entry;
480  if (group_Z < zDist)
481  {
482  zDist = group_Z;
483  hit = prims + entry;
484  }
485 #ifdef VMAP_DEBUG
486  const GroupModel &gm = prims[entry];
487  printf("%10u %8X %7.3f, %7.3f, %7.3f | %7.3f, %7.3f, %7.3f | z=%f, p_z=%f\n", gm.GetWmoID(), gm.GetMogpFlags(),
488  gm.GetBound().low().x, gm.GetBound().low().y, gm.GetBound().low().z,
489  gm.GetBound().high().x, gm.GetBound().high().y, gm.GetBound().high().z, group_Z, point.z);
490 #endif
491  }
492  //}
493  //std::cout << "trying to intersect '" << prims[entry].name << "'\n";
494  }
std::vector< GroupModel >::const_iterator prims
Definition: WorldModel.cpp:464
float zDist
Definition: WorldModel.cpp:467
std::vector< GroupModel >::const_iterator hit
Definition: WorldModel.cpp:465
float z
Definition: Vector3.h:62
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083
Vector3 zVec
Definition: WorldModel.cpp:468

+ Here is the call graph for this function:

Member Data Documentation

std::vector<GroupModel>::const_iterator VMAP::WModelAreaCallback::hit
float VMAP::WModelAreaCallback::minVol
std::vector<GroupModel>::const_iterator VMAP::WModelAreaCallback::prims
float VMAP::WModelAreaCallback::zDist
Vector3 VMAP::WModelAreaCallback::zVec

The documentation for this class was generated from the following file: