#include "Recast.h"
#include "RecastAlloc.h"
#include "RecastAssert.h"
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
namespace
{
template<typename T>
T* rcNew(const rcAllocHint allocLifetime)
{ … }
template<typename T>
void rcDelete(T* ptr)
{ … }
}
float rcSqrt(float x)
{ … }
void rcContext::log(const rcLogCategory category, const char* format, ...)
{ … }
void rcContext::doResetLog()
{ … }
rcHeightfield* rcAllocHeightfield()
{ … }
void rcFreeHeightField(rcHeightfield* heightfield)
{ … }
rcHeightfield::rcHeightfield()
: … { … }
rcHeightfield::~rcHeightfield()
{ … }
rcCompactHeightfield* rcAllocCompactHeightfield()
{ … }
void rcFreeCompactHeightfield(rcCompactHeightfield* compactHeightfield)
{ … }
rcCompactHeightfield::rcCompactHeightfield()
: … { … }
rcCompactHeightfield::~rcCompactHeightfield()
{ … }
rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet()
{ … }
void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* layerSet)
{ … }
rcHeightfieldLayerSet::rcHeightfieldLayerSet()
: … { … }
rcHeightfieldLayerSet::~rcHeightfieldLayerSet()
{ … }
rcContourSet* rcAllocContourSet()
{ … }
void rcFreeContourSet(rcContourSet* contourSet)
{ … }
rcContourSet::rcContourSet()
: … { … }
rcContourSet::~rcContourSet()
{ … }
rcPolyMesh* rcAllocPolyMesh()
{ … }
void rcFreePolyMesh(rcPolyMesh* polyMesh)
{ … }
rcPolyMesh::rcPolyMesh()
: … { … }
rcPolyMesh::~rcPolyMesh()
{ … }
rcPolyMeshDetail* rcAllocPolyMeshDetail()
{ … }
void rcFreePolyMeshDetail(rcPolyMeshDetail* detailMesh)
{ … }
rcPolyMeshDetail::rcPolyMeshDetail()
: … { … }
void rcCalcBounds(const float* verts, int numVerts, float* minBounds, float* maxBounds)
{ … }
void rcCalcGridSize(const float* minBounds, const float* maxBounds, const float cellSize, int* sizeX, int* sizeZ)
{ … }
bool rcCreateHeightfield(rcContext* context, rcHeightfield& heightfield, int sizeX, int sizeZ,
const float* minBounds, const float* maxBounds,
float cellSize, float cellHeight)
{ … }
static void calcTriNormal(const float* v0, const float* v1, const float* v2, float* faceNormal)
{ … }
void rcMarkWalkableTriangles(rcContext* context, const float walkableSlopeAngle,
const float* verts, const int numVerts,
const int* tris, const int numTris,
unsigned char* triAreaIDs)
{ … }
void rcClearUnwalkableTriangles(rcContext* context, const float walkableSlopeAngle,
const float* verts, int numVerts,
const int* tris, int numTris,
unsigned char* triAreaIDs)
{ … }
int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfield)
{ … }
bool rcBuildCompactHeightfield(rcContext* context, const int walkableHeight, const int walkableClimb,
const rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield)
{ … }