AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
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
 

Detailed Description

Constructor & Destructor Documentation

◆ WModelAreaCallback()

VMAP::WModelAreaCallback::WModelAreaCallback ( const std::vector< GroupModel > &  vals,
const Vector3 &  down 
)
inline
544 :
545 prims(vals.begin()), hit(vals.end()), minVol(G3D::inf()), zDist(G3D::inf()), zVec(down) { }
std::vector< GroupModel >::const_iterator hit
Definition: WorldModel.cpp:547
float minVol
Definition: WorldModel.cpp:548
Vector3 zVec
Definition: WorldModel.cpp:550
std::vector< GroupModel >::const_iterator prims
Definition: WorldModel.cpp:546
float zDist
Definition: WorldModel.cpp:549

Member Function Documentation

◆ operator()()

void VMAP::WModelAreaCallback::operator() ( const Vector3 &  point,
uint32  entry 
)
inline
552 {
553 float group_Z;
554 //float pVol = prims[entry].GetBound().volume();
555 //if (pVol < minVol)
556 //{
557 /* if (prims[entry].iBound.contains(point)) */
558 if (prims[entry].IsInsideObject(point, zVec, group_Z))
559 {
560 //minVol = pVol;
561 //hit = prims + entry;
562 if (group_Z < zDist)
563 {
564 zDist = group_Z;
565 hit = prims + entry;
566 }
567#ifdef VMAP_DEBUG
568 const GroupModel& gm = prims[entry];
569 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(),
570 gm.GetBound().low().x, gm.GetBound().low().y, gm.GetBound().low().z,
571 gm.GetBound().high().x, gm.GetBound().high().y, gm.GetBound().high().z, group_Z, point.z);
572#endif
573 }
574 //}
575 //std::cout << "trying to intersect '" << prims[entry].name << "'\n";
576 }

References VMAP::GroupModel::GetBound(), VMAP::GroupModel::GetMogpFlags(), VMAP::GroupModel::GetWmoID(), hit, prims, zDist, and zVec.

Member Data Documentation

◆ hit

std::vector<GroupModel>::const_iterator VMAP::WModelAreaCallback::hit

◆ minVol

float VMAP::WModelAreaCallback::minVol

◆ prims

std::vector<GroupModel>::const_iterator VMAP::WModelAreaCallback::prims

Referenced by operator()().

◆ zDist

float VMAP::WModelAreaCallback::zDist

◆ zVec

Vector3 VMAP::WModelAreaCallback::zVec

Referenced by operator()().