本文整理汇总了C++中MapTree::getObjectHitPos方法的典型用法代码示例。如果您正苦于以下问题:C++ MapTree::getObjectHitPos方法的具体用法?C++ MapTree::getObjectHitPos怎么用?C++ MapTree::getObjectHitPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapTree
的用法示例。
在下文中一共展示了MapTree::getObjectHitPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getObjectHitPos
/**
get the hit position and return true if we hit something
otherwise the result pos will be the dest pos
*/
bool VMapManager::getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist)
{
bool result = false;
rx=x2;
ry=y2;
rz=z2;
if(isLineOfSightCalcEnabled())
{
if(iInstanceMapTrees.containsKey(pMapId))
{
Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
Vector3 resultPos;
MapTree* mapTree = iInstanceMapTrees.get(pMapId);
result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist);
resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z);
rx = resultPos.x;
ry = resultPos.y;
rz = resultPos.z;
#ifdef _VMAP_LOG_DEBUG
Command c = Command();
c.fillTestObjectHitCmd(pMapId, pos1, pos2, resultPos, result);
iCommandLogger.appendCmd(c);
#endif
}
}
return result;
}
示例2: getObjectHitPos
bool VMapManager::getObjectHitPos(unsigned int pMapId, LocationVector & v1, LocationVector & v2, LocationVector & vout, float pModifyDist)
{
bool result = false;
vout = v2;
if( m_maps[pMapId] != NULL )
{
Vector3 pos1 = convertPositionToInternalRepMod(v1);
Vector3 pos2 = convertPositionToInternalRepMod(v2);
Vector3 resultPos;
MapTree* mapTree = m_maps[pMapId];
result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist);
vout = convertPositionToMangosRep(resultPos);
}
return result;
}