mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-13 07:14:31 +00:00
anonymous namespace
This commit is contained in:
parent
0a187e56aa
commit
905cff2a94
@ -13,6 +13,15 @@
|
|||||||
#include <boost/graph/adjacency_list.hpp>
|
#include <boost/graph/adjacency_list.hpp>
|
||||||
#include "boost/tuple/tuple.hpp"
|
#include "boost/tuple/tuple.hpp"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
float sgn(float a)
|
||||||
|
{
|
||||||
|
if(a>0) return 1.;
|
||||||
|
else return -1.;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -26,12 +35,6 @@ namespace MWMechanics
|
|||||||
return new AiTravel(*this);
|
return new AiTravel(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float sgn(float a)
|
|
||||||
{
|
|
||||||
if(a>0) return 1.;
|
|
||||||
else return -1.;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AiTravel::execute (const MWWorld::Ptr& actor)
|
bool AiTravel::execute (const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
const ESM::Pathgrid *pathgrid =
|
const ESM::Pathgrid *pathgrid =
|
||||||
|
@ -4,10 +4,9 @@
|
|||||||
#include "boost/tuple/tuple.hpp"
|
#include "boost/tuple/tuple.hpp"
|
||||||
#include "OgreMath.h"
|
#include "OgreMath.h"
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace
|
||||||
{
|
{
|
||||||
|
//helpers functions
|
||||||
//helpers functions
|
|
||||||
float distanceZCorrected(ESM::Pathgrid::Point point,float x,float y,float z)
|
float distanceZCorrected(ESM::Pathgrid::Point point,float x,float y,float z)
|
||||||
{
|
{
|
||||||
return sqrt((point.mX - x)*(point.mX - x)+(point.mY - y)*(point.mY - y)+0.1*(point.mZ - z)*(point.mZ - z));
|
return sqrt((point.mX - x)*(point.mX - x)+(point.mY - y)*(point.mY - y)+0.1*(point.mZ - z)*(point.mZ - z));
|
||||||
@ -89,7 +88,10 @@ namespace MWMechanics
|
|||||||
const PathGridGraph & mGraph;
|
const PathGridGraph & mGraph;
|
||||||
PointID mGoal;
|
PointID mGoal;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace MWMechanics
|
||||||
|
{
|
||||||
PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCell = 0)
|
PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCell = 0)
|
||||||
{
|
{
|
||||||
PathGridGraph graph;
|
PathGridGraph graph;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user