mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
beeb882ea8
To reduce cache size and make it more flexible. Adding off mesh connections to the navmesh is the last step of navmesh generation and it's very fast comparing to other steps (microseconds vs milliseconds). Having less cache size makes get and set operations almost 2x times faster that also have an order of microseconds. So in total there is no performance impact.
27 lines
577 B
C++
27 lines
577 B
C++
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTION_H
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_OFFMESHCONNECTION_H
|
|
|
|
#include "areatype.hpp"
|
|
|
|
#include <osg/Vec3f>
|
|
|
|
#include <vector>
|
|
#include <tuple>
|
|
|
|
namespace DetourNavigator
|
|
{
|
|
struct OffMeshConnection
|
|
{
|
|
osg::Vec3f mStart;
|
|
osg::Vec3f mEnd;
|
|
AreaType mAreaType;
|
|
};
|
|
|
|
inline bool operator<(const OffMeshConnection& lhs, const OffMeshConnection& rhs)
|
|
{
|
|
return std::tie(lhs.mStart, lhs.mEnd, lhs.mAreaType) < std::tie(rhs.mStart, rhs.mEnd, rhs.mAreaType);
|
|
}
|
|
}
|
|
|
|
#endif
|