mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
482 B
C++
22 lines
482 B
C++
3 years ago
|
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTPARAMS_H
|
||
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTPARAMS_H
|
||
|
|
||
|
#include <osg/Vec3f>
|
||
|
|
||
|
#include <cmath>
|
||
|
|
||
|
namespace DetourNavigator
|
||
|
{
|
||
|
inline float getAgentHeight(const osg::Vec3f& agentHalfExtents)
|
||
|
{
|
||
|
return 2.0f * agentHalfExtents.z();
|
||
|
}
|
||
|
|
||
|
inline float getAgentRadius(const osg::Vec3f& agentHalfExtents)
|
||
|
{
|
||
|
return std::max(agentHalfExtents.x(), agentHalfExtents.y()) * std::sqrt(2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|