Atoms Crowd  7.0.0
AtomsUtils Namespace Reference

AtomsCore namespace. More...

Classes

class  Base64
 Base64 encode/decode. More...
 
struct  BVHNode
 
struct  MortonCode
 
class  Bvh
 
class  Curve
 Nurbs curve. More...
 
class  Edge
 Edge class. More...
 
class  Image
 Image class. More...
 
class  JSONValue
 
class  JSON
 
class  BoxEdge
 
class  KdTreeAccel
 
class  KdTreeAccel_base
 
class  KdTreeNode
 
class  SAH
 
class  KdTreePoint
 
class  LogType
 Log type class. More...
 
class  LogProxy
 Logger proxy class. More...
 
class  Logger
 Logger class. More...
 
class  Mesh
 Mesh class. More...
 
class  dtScopedDelete
 
class  dtIntArray
 A simple dynamic array of integers. More...
 
class  dtChunkArray
 A simple dynamic array of integers. More...
 
struct  dtPoly
 
struct  dtPolyDetail
 Defines the location of detail sub-mesh data within a dtMeshTile. More...
 
struct  dtLink
 
struct  dtBVNode
 
struct  dtOffMeshSegmentConnection
 
struct  dtOffMeshConnection
 
struct  dtCluster
 Cluster of polys. More...
 
struct  dtClusterLink
 Links between clusters. More...
 
struct  dtMeshHeader
 
struct  dtMeshTile
 
struct  dtNavMeshParams
 
class  dtNavMesh
 
struct  ReadTilesHelper
 
struct  dtOffMeshLinkCreateParams
 
struct  dtDynamicAreaCreateParams
 
struct  dtNavMeshCreateParams
 
struct  dtQuerySpecialLinkFilter
 
struct  dtQueryFilterData
 
class  dtQueryFilter
 
struct  dtQueryResultPack
 
struct  dtQueryResult
 
class  dtNavMeshQuery
 
struct  dtNode
 
class  dtNodePool
 
class  dtNodeQueue
 
class  dtPathCorridor
 
struct  dtCompressedTile
 
struct  dtTileCacheObstacle
 
struct  dtTileCacheParams
 
struct  dtTileCacheMeshProcess
 
class  dtTileCache
 
struct  dtTileCacheLayerHeader
 
struct  dtTileCacheLayer
 
struct  dtTileCacheContour
 
struct  dtTileCacheContourSet
 
struct  dtTileCacheClusterSet
 
struct  dtTileCachePolyMesh
 
struct  dtTileCachePolyMeshDetail
 
struct  dtTileCacheDistanceField
 
class  dtTileCacheLogContext
 
struct  dtTileCacheAlloc
 
struct  dtTileCacheCompressor
 
class  dtFixedArray
 
class  NavMeshPath
 
class  NavMesh
 
class  rcContext
 
struct  rcConfig
 
struct  rcSpanData
 
struct  rcSpanCache
 
struct  rcSpan
 
struct  rcSpanPool
 
struct  rcRowExt
 
struct  rcEdgeHit
 
struct  rcTempSpan
 
struct  rcHeightfield
 
struct  rcCompactCell
 Provides information on the content of a cell column in a compact heightfield. More...
 
struct  rcCompactSpan
 Represents a span of unobstructed space within a compact heightfield. More...
 
struct  rcCompactHeightfield
 
struct  rcHeightfieldLayer
 
struct  rcHeightfieldLayerSet
 
struct  rcContour
 Represents a simple, non-overlapping contour in field space. More...
 
struct  rcContourSet
 
struct  rcClusterSet
 
struct  rcPolyMesh
 
struct  rcPolyMeshDetail
 
class  rcIntArray
 A simple dynamic array of integers. More...
 
class  rcScopedDelete
 
class  rcScopedStructArrayDelete
 
class  RecastContext
 Base64 encode/decode. More...
 
class  PathSolverFilter
 
class  PathSolver
 
class  SampledCurve
 Nurbs curve. More...
 
struct  ParallelForRange
 
class  Triangle
 Triangle class. More...
 
class  Triangle2
 Triangle 2D class. More...
 

Typedefs

typedef Edge< AtomsMath::Vector2f > Edge2
 
typedef Edge< AtomsMath::Vector3f > Edge3
 
typedef std::vector< JSONValue * > JSONArray
 
typedef std::map< std::wstring, JSONValue * > JSONObject
 
typedef std::vector< BoxEdgev_BoxEdge
 
typedef std::vector< v_BoxEdge > vv_BoxEdge
 
typedef std::vector< BoxEdge * > vp_BoxEdge
 
typedef std::vector< vp_BoxEdge > vvp_BoxEdge
 
typedef void *() dtAllocFunc(int size, dtAllocHint hint)
 A memory allocation function. More...
 
typedef void() dtFreeFunc(void *ptr)
 
typedef uint64_t Type_uint64
 
typedef Type_uint64 dtPolyRef
 
typedef Type_uint64 dtTileRef
 
typedef Type_uint64 dtClusterRef
 A handle to a cluster within a navigation mesh tile.
 
typedef unsigned short dtNodeIndex
 
typedef unsigned int dtStatus
 
typedef unsigned int dtObstacleRef
 
typedef unsigned int dtCompressedTileRef
 
typedef dtNavMeshQuery NavMeshQuery
 
typedef void *() rcAllocFunc(int size, rcAllocHint hint)
 A memory allocation function. More...
 
typedef void() rcFreeFunc(void *ptr)
 

Enumerations

enum  BVHNodeType { INTERNAL , LEAF }
 
enum  JSONType {
  JSONType_Null , JSONType_String , JSONType_Bool , JSONType_Number ,
  JSONType_Array , JSONType_Object
}
 
enum  dtAllocHint { DT_ALLOC_PERM , DT_ALLOC_TEMP }
 
enum  dtTileFlags { DT_TILE_FREE_DATA = 0x01 }
 
enum  dtStraightPathFlags { DT_STRAIGHTPATH_START = 0x01 , DT_STRAIGHTPATH_END = 0x02 , DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04 }
 Vertex flags returned by dtNavMeshQuery::findStraightPath. More...
 
enum  dtStraightPathOptions { DT_STRAIGHTPATH_AREA_CROSSINGS = 0x01 , DT_STRAIGHTPATH_ALL_CROSSINGS = 0x02 }
 Options for dtNavMeshQuery::findStraightPath. More...
 
enum  dtPolyTypes { DT_POLYTYPE_GROUND = 0 , DT_POLYTYPE_OFFMESH_POINT = 1 , DT_POLYTYPE_OFFMESH_SEGMENT = 2 }
 Flags representing the type of a navigation mesh polygon. More...
 
enum  dtDetailTriEdgeFlags { DT_DETAIL_EDGE_BOUNDARY = 0x01 }
 
enum  dtNodeFlags { DT_NODE_OPEN = 0x01 , DT_NODE_CLOSED = 0x02 }
 
enum  dtCompressedTileFlags { DT_COMPRESSEDTILE_FREE_DATA = 0x01 }
 Flags for addTile. More...
 
enum  ObstacleState { DT_OBSTACLE_EMPTY , DT_OBSTACLE_PROCESSING , DT_OBSTACLE_PROCESSED , DT_OBSTACLE_REMOVING }
 
enum  rcLogCategory { RC_LOG_PROGRESS = 1 , RC_LOG_WARNING , RC_LOG_ERROR }
 
enum  rcTimerLabel {
  RC_TIMER_TOTAL , RC_TIMER_TEMP , RC_TIMER_RASTERIZE_TRIANGLES , RC_TIMER_BUILD_COMPACTHEIGHTFIELD ,
  RC_TIMER_BUILD_CONTOURS , RC_TIMER_BUILD_CONTOURS_TRACE , RC_TIMER_BUILD_CONTOURS_SIMPLIFY , RC_TIMER_BUILD_CLUSTERS ,
  RC_TIMER_FILTER_BORDER , RC_TIMER_FILTER_WALKABLE , RC_TIMER_MEDIAN_AREA , RC_TIMER_FILTER_LOW_OBSTACLES ,
  RC_TIMER_BUILD_POLYMESH , RC_TIMER_MERGE_POLYMESH , RC_TIMER_ERODE_AREA , RC_TIMER_MARK_BOX_AREA ,
  RC_TIMER_MARK_CYLINDER_AREA , RC_TIMER_MARK_CONVEXPOLY_AREA , RC_TIMER_BUILD_DISTANCEFIELD , RC_TIMER_BUILD_DISTANCEFIELD_DIST ,
  RC_TIMER_BUILD_DISTANCEFIELD_BLUR , RC_TIMER_BUILD_REGIONS , RC_TIMER_BUILD_REGIONS_WATERSHED , RC_TIMER_BUILD_REGIONS_EXPAND ,
  RC_TIMER_BUILD_REGIONS_FLOOD , RC_TIMER_BUILD_REGIONS_FILTER , RC_TIMER_BUILD_LAYERS , RC_TIMER_BUILD_POLYMESHDETAIL ,
  RC_TIMER_MERGE_POLYMESHDETAIL , RC_MAX_TIMERS
}
 
enum  rcRegionPartitioning { RC_REGION_MONOTONE , RC_REGION_WATERSHED , RC_REGION_CHUNKY }
 
enum  rcBuildContoursFlags { RC_CONTOUR_TESS_WALL_EDGES = 0x01 , RC_CONTOUR_TESS_AREA_EDGES = 0x02 }
 
enum  rcFilterLowAreaFlags { RC_LOW_FILTER_SEED_SPANS = 0x01 , RC_LOW_FILTER_POST_PROCESS = 0x02 }
 
enum  rcRasterizationFlags { RC_PROJECT_TO_BOTTOM = 1 << 0 }
 
enum  rcAllocHint { RC_ALLOC_PERM , RC_ALLOC_TEMP }
 

Functions

ATOMSUTILS_EXPORT std::vector< AtomsMath::Vector3 > generateCurveSamples (const AtomsUtils::Curve &curve, size_t numSamples, size_t numPointPerSample, double sampleSpacing, size_t randNumPoint, size_t seed, const AtomsMath::Vector3 &randomSpace, double minDist, const AtomsMath::Vector3 &upVector, const bool returnTangentDirections, std::vector< AtomsMath::Vector3 > &sampleDirections)
 Generate poisson samples. More...
 
template<class T >
std::ostream & operator<< (std::ostream &os, const Edge< T > &e)
 
ATOMSUTILS_EXPORT bool sphereRayIntersect (const AtomsMath::Vector3 &dir, const AtomsMath::Vector3 &orig, const AtomsMath::Vector3 &center, const double radius, double &t0, double &t1)
 Sphere ray intersector. More...
 
ATOMSUTILS_EXPORT bool intersectPlane (const AtomsMath::Vector3 &n, const AtomsMath::Vector3 &p0, const AtomsMath::Vector3 &l0, const AtomsMath::Vector3 &l, double &t)
 
ATOMSUTILS_EXPORT bool intersectDisk (const AtomsMath::Vector3 &n, const AtomsMath::Vector3 &p0, const float &radius, const AtomsMath::Vector3 &l0, const AtomsMath::Vector3 &l)
 
ATOMSUTILS_EXPORT bool intersectTriangleDisk2d (const AtomsMath::Vector3 &n, const AtomsMath::Vector3 &p0, const float &radius, const AtomsMath::Vector3 &v0, const AtomsMath::Vector3 &v1, const AtomsMath::Vector3 &v2)
 
ATOMSUTILS_EXPORT unsigned char * compressBuffer (unsigned char *input, size_t inBufferSize, size_t &outBufferSize)
 zlib compression
 
ATOMSUTILS_EXPORT unsigned char * decompressBuffer (unsigned char *input, size_t inBufferSize, size_t &outBufferSize)
 zlib decompression
 
ATOMSUTILS_EXPORT std::vector< AtomsMath::Vector3 > generateDartThrowSamples (const AtomsUtils::Mesh &mesh, const AtomsMath::Matrix &meshMatrix, float defaultRadius, float maxRadius, size_t seed, size_t numSamples, size_t iterations=10000, bool randomizeRadius=false, AtomsUtils::Image *densityMap=nullptr, AtomsUtils::Image *eraseMap=nullptr, double eraseThreshold=1.0)
 Generate poisson samples. More...
 
ATOMSUTILS_EXPORT std::vector< AtomsMath::Vector3 > generateUVSamples (const Mesh &mesh, unsigned int numUSamples, unsigned int numVSamples, const bool generateUVData=false)
 
ATOMSUTILS_EXPORT void dtAllocSetCustom (dtAllocFunc *allocFunc, dtFreeFunc *freeFunc)
 
ATOMSUTILS_EXPORT void * dtAlloc (int size, dtAllocHint hint)
 
ATOMSUTILS_EXPORT void dtFree (void *ptr)
 
void dtMemCpy (void *dst, void *src, int size)
 
float dtMathFabsf (float x)
 
float dtMathSqrtf (float x)
 
float dtMathFloorf (float x)
 
float dtMathCeilf (float x)
 
float dtMathCosf (float x)
 
float dtMathSinf (float x)
 
float dtMathAtan2f (float y, float x)
 
bool dtMathIsfinite (float x)
 
ATOMSUTILS_EXPORT dtNavMeshdtAllocNavMesh ()
 
ATOMSUTILS_EXPORT void dtFreeNavMesh (dtNavMesh *navmesh)
 
ATOMSUTILS_EXPORT bool dtCreateNavMeshData (dtNavMeshCreateParams *params, unsigned char **outData, int *outDataSize)
 
ATOMSUTILS_EXPORT bool dtNavMeshHeaderSwapEndian (unsigned char *data, const int dataSize)
 
ATOMSUTILS_EXPORT bool dtNavMeshDataSwapEndian (unsigned char *data, const int dataSize)
 
ATOMSUTILS_EXPORT dtNavMeshQuerydtAllocNavMeshQuery ()
 
ATOMSUTILS_EXPORT void dtFreeNavMeshQuery (dtNavMeshQuery *query)
 
int dtMergeCorridorStartMoved (dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
 
int dtMergeCorridorEndMoved (dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
 
int dtMergeCorridorStartShortcut (dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
 
bool dtStatusSucceed (dtStatus status)
 
bool dtStatusFailed (dtStatus status)
 
bool dtStatusInProgress (dtStatus status)
 
bool dtStatusDetail (dtStatus status, unsigned int detail)
 
ATOMSUTILS_EXPORT dtTileCachedtAllocTileCache ()
 
ATOMSUTILS_EXPORT void dtFreeTileCache (dtTileCache *tc)
 
int getDirOffsetX (int dir)
 
int getDirOffsetY (int dir)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheLayer (dtTileCacheCompressor *comp, dtTileCacheLayerHeader *header, const unsigned short *heights, const unsigned char *areas, const unsigned char *cons, unsigned char **outData, int *outDataSize)
 
ATOMSUTILS_EXPORT void dtFreeTileCacheLayer (dtTileCacheAlloc *alloc, dtTileCacheLayer *layer)
 
ATOMSUTILS_EXPORT dtStatus dtDecompressTileCacheLayer (dtTileCacheAlloc *alloc, dtTileCacheCompressor *comp, unsigned char *compressed, const int compressedSize, dtTileCacheLayer **layerOut)
 
ATOMSUTILS_EXPORT dtTileCacheContourSetdtAllocTileCacheContourSet (dtTileCacheAlloc *alloc)
 
ATOMSUTILS_EXPORT void dtFreeTileCacheContourSet (dtTileCacheAlloc *alloc, dtTileCacheContourSet *cset)
 
ATOMSUTILS_EXPORT dtTileCacheClusterSetdtAllocTileCacheClusterSet (dtTileCacheAlloc *alloc)
 
ATOMSUTILS_EXPORT void dtFreeTileCacheClusterSet (dtTileCacheAlloc *alloc, dtTileCacheClusterSet *clusters)
 
ATOMSUTILS_EXPORT dtTileCachePolyMeshdtAllocTileCachePolyMesh (dtTileCacheAlloc *alloc)
 
ATOMSUTILS_EXPORT void dtFreeTileCachePolyMesh (dtTileCacheAlloc *alloc, dtTileCachePolyMesh *lmesh)
 
ATOMSUTILS_EXPORT dtTileCachePolyMeshDetaildtAllocTileCachePolyMeshDetail (dtTileCacheAlloc *alloc)
 
ATOMSUTILS_EXPORT void dtFreeTileCachePolyMeshDetail (dtTileCacheAlloc *alloc, dtTileCachePolyMeshDetail *dmesh)
 
ATOMSUTILS_EXPORT dtTileCacheDistanceFielddtAllocTileCacheDistanceField (dtTileCacheAlloc *alloc)
 
ATOMSUTILS_EXPORT void dtFreeTileCacheDistanceField (dtTileCacheAlloc *alloc, dtTileCacheDistanceField *dfield)
 
ATOMSUTILS_EXPORT dtStatus dtMarkCylinderArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *pos, const float radius, const float height, const unsigned char areaId)
 
ATOMSUTILS_EXPORT dtStatus dtMarkBoxArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *pos, const float *extent, const unsigned char areaId)
 
ATOMSUTILS_EXPORT dtStatus dtMarkConvexArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *verts, const int nverts, const float hmin, const float hmax, const unsigned char areaId)
 
ATOMSUTILS_EXPORT dtStatus dtReplaceCylinderArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *pos, const float radius, const float height, const unsigned char areaId, const unsigned char filterAreaId)
 
ATOMSUTILS_EXPORT dtStatus dtReplaceBoxArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *pos, const float *extent, const unsigned char areaId, const unsigned char filterAreaId)
 
ATOMSUTILS_EXPORT dtStatus dtReplaceConvexArea (dtTileCacheLayer &layer, const float *orig, const float cs, const float ch, const float *verts, const int nverts, const float hmin, const float hmax, const unsigned char areaId, const unsigned char filterAreaId)
 
ATOMSUTILS_EXPORT dtStatus dtReplaceArea (dtTileCacheLayer &layer, const unsigned char areaId, const unsigned char filterAreaId)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheDistanceField (dtTileCacheAlloc *alloc, dtTileCacheLayer &layer, dtTileCacheDistanceField &dfield)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheRegions (dtTileCacheAlloc *alloc, const int minRegionArea, const int mergeRegionArea, dtTileCacheLayer &layer, dtTileCacheDistanceField dfield)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheRegionsMonotone (dtTileCacheAlloc *alloc, const int minRegionArea, const int mergeRegionArea, dtTileCacheLayer &layer)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheRegionsChunky (dtTileCacheAlloc *alloc, const int minRegionArea, const int mergeRegionArea, dtTileCacheLayer &layer, int regionChunkSize)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheContours (dtTileCacheAlloc *alloc, dtTileCacheLayer &layer, const int walkableClimb, const float maxError, const float cs, const float ch, dtTileCacheContourSet &lcset, dtTileCacheClusterSet &lclusters)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCachePolyMesh (dtTileCacheAlloc *alloc, dtTileCacheLogContext *ctx, dtTileCacheContourSet &lcset, dtTileCachePolyMesh &mesh)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCachePolyMeshDetail (dtTileCacheAlloc *alloc, const float cs, const float ch, const float sampleDist, const float sampleMaxError, dtTileCacheLayer &layer, dtTileCachePolyMesh &lmesh, dtTileCachePolyMeshDetail &dmesh)
 
ATOMSUTILS_EXPORT dtStatus dtBuildTileCacheClusters (dtTileCacheAlloc *alloc, dtTileCacheClusterSet &lclusters, dtTileCachePolyMesh &lmesh)
 
ATOMSUTILS_EXPORT bool dtTileCacheHeaderSwapEndian (unsigned char *data, const int dataSize)
 
ATOMSUTILS_EXPORT void rcAllocSetCustom (rcAllocFunc *allocFunc, rcFreeFunc *freeFunc)
 
void * rcAlloc (int size, rcAllocHint hint)
 
void rcFree (void *ptr)
 
void rcMemCpy (void *dst, void *src, int size)
 
ATOMSUTILS_EXPORT std::string solvePath (const std::string &path)
 
ATOMSUTILS_EXPORT std::vector< AtomsMath::Vector3 > generatePoissonPoints (size_t NumPoints, float radius, int NewPointsCount=30, short shape=0, float MinDist=-1.0f, unsigned int seed=0, const unsigned char *pixels=nullptr, short numChannels=3, unsigned int imageWidth=0, unsigned int imageHeight=0)
 Generate poisson samples. More...
 
ATOMSUTILS_EXPORT void setParallelForDispatcher (const std::function< void(const ParallelForRange &rg, const std::function< void(const ParallelForRange &)> &)> &body)
 
ATOMSUTILS_EXPORT void parallel_for (const ParallelForRange &rg, const std::function< void(const ParallelForRange &)> &body, const bool singleThread=false)
 
template<typename T >
std::vector< T >::iterator findInVector (typename std::vector< T >::iterator itBegin, typename std::vector< T >::iterator itEnd, const T &value)
 
template<>
std::vector< std::string >::iterator findInVector (typename std::vector< std::string >::iterator itBegin, typename std::vector< std::string >::iterator itEnd, const std::string &value)
 
ATOMSUTILS_EXPORT std::string expandEnvironmentVariables (const std::string &s)
 
ATOMSUTILS_EXPORT std::string replaceString (const std::string &s, const std::string &source, const std::string &dest)
 
ATOMSUTILS_EXPORT void splitString (const std::string &s, char delim, std::vector< std::string > &elems)
 
ATOMSUTILS_EXPORT void splitString (const std::string s, const std::string &delim, std::vector< std::string > &elems)
 
ATOMSUTILS_EXPORT std::string joinString (const std::string &delimiter, const std::vector< std::string > &elements)
 
ATOMSUTILS_EXPORT bool endsWith (const std::string &fullString, const std::string &ending)
 
ATOMSUTILS_EXPORT bool startsWith (const std::string &fullString, const std::string &prefix)
 
ATOMSUTILS_EXPORT bool fileExists (const char *filename)
 
ATOMSUTILS_EXPORT bool dirExists (const char *pathname)
 
ATOMSUTILS_EXPORT bool mkDir (const char *pathname)
 
ATOMSUTILS_EXPORT bool envVariableExists (const char *envName)
 
ATOMSUTILS_EXPORT std::string fileExtension (const std::string &filename)
 
ATOMSUTILS_EXPORT std::string fileDirectory (const std::string &filename)
 
ATOMSUTILS_EXPORT std::string fileBaseName (const std::string &filename, bool extension=true)
 
ATOMSUTILS_EXPORT std::string wstringToString (const std::wstring &wstr)
 
ATOMSUTILS_EXPORT std::wstring stringToWString (const std::string str)
 
ATOMSUTILS_EXPORT std::string toUpper (const std::string &s)
 
ATOMSUTILS_EXPORT std::string toLower (const std::string &s)
 
ATOMSUTILS_EXPORT std::string generateHash ()
 
ATOMSUTILS_EXPORT bool checkHash (const std::string &hash)
 
ATOMSUTILS_EXPORT bool jsonHasKey (const std::wstring &wstr, const JSONObject &jsonObj)
 
ATOMSUTILS_EXPORT std::vector< std::string > getFilesFromFolder (const std::string &path, const std::string &extension)
 
ATOMSUTILS_EXPORT std::vector< std::string > getFolders (const std::string &path)
 
ATOMSUTILS_EXPORT std::string eraseFromString (const std::string &s, char delim)
 
ATOMSUTILS_EXPORT std::string eraseFromString (const std::string &s, const std::string &subString)
 
ATOMSUTILS_EXPORT bool simpleRegExp (const std::string &exp, const std::string &value)
 
ATOMSUTILS_EXPORT bool filterNames (const std::vector< std::string > &filters, const std::string &geoName)
 
ATOMSUTILS_EXPORT std::string getKeys ()
 
General helper functions
template<class T >
void dtSwap (T &a, T &b)
 
template<class T >
dtMin (T a, T b)
 
template<class T >
dtMax (T a, T b)
 
template<class T >
dtAbs (T a)
 
template<class T >
dtSqr (T a)
 
template<class T >
dtClamp (T v, T mn, T mx)
 
ATOMSUTILS_EXPORT float dtSqrt (float x)
 
template<class T >
void rcSwap (T &a, T &b)
 
template<class T >
rcMin (T a, T b)
 
template<class T >
rcMax (T a, T b)
 
template<class T >
rcAbs (T a)
 
template<class T >
rcSqr (T a)
 
template<class T >
rcClamp (T v, T mn, T mx)
 
float rcSqrt (float x)
 
Vector helper functions.
void dtVcross (float *dest, const float *v1, const float *v2)
 
float dtVdot (const float *v1, const float *v2)
 
void dtVmad (float *dest, const float *v1, const float *v2, const float s)
 
void dtVlerp (float *dest, const float *v1, const float *v2, const float t)
 
void dtVadd (float *dest, const float *v1, const float *v2)
 
void dtVsub (float *dest, const float *v1, const float *v2)
 
void dtVscale (float *dest, const float *v, const float t)
 
void dtVmin (float *mn, const float *v)
 
void dtVmax (float *mx, const float *v)
 
void dtVset (float *dest, const float x, const float y, const float z)
 
void dtVcopy (float *dest, const float *a)
 
float dtVlen (const float *v)
 
float dtVlenSqr (const float *v)
 
ATOMSUTILS_EXPORT float dtVdist (const float *v1, const float *v2)
 
float dtVdistSqr (const float *v1, const float *v2)
 
float dtVdist2D (const float *v1, const float *v2)
 
float dtVdist2DSqr (const float *v1, const float *v2)
 
void dtVnormalize (float *v)
 
bool dtVequal (const float *p0, const float *p1)
 
float dtVdot2D (const float *u, const float *v)
 
float dtVperp2D (const float *u, const float *v)
 
void rcVcross (float *dest, const float *v1, const float *v2)
 
float rcVdot (const float *v1, const float *v2)
 
void rcVmad (float *dest, const float *v1, const float *v2, const float s)
 
void rcVadd (float *dest, const float *v1, const float *v2)
 
void rcVsub (float *dest, const float *v1, const float *v2)
 
void rcVmin (float *mn, const float *v)
 
void rcVmax (float *mx, const float *v)
 
void rcVcopy (float *dest, const float *v)
 
float rcVdist (const float *v1, const float *v2)
 
float rcVdistSqr (const float *v1, const float *v2)
 
void rcVnormalize (float *v)
 
Computational geometry helper functions.
float dtTriArea2D (const float *a, const float *b, const float *c)
 
bool dtOverlapQuantBounds (const unsigned short amin[3], const unsigned short amax[3], const unsigned short bmin[3], const unsigned short bmax[3])
 
bool dtOverlapBounds (const float *amin, const float *amax, const float *bmin, const float *bmax)
 
void dtClosestPtPointTriangle (float *closest, const float *p, const float *a, const float *b, const float *c)
 
bool dtClosestHeightPointTriangle (const float *p, const float *a, const float *b, const float *c, float &h)
 
bool dtIntersectSegmentPoly2D (const float *p0, const float *p1, const float *verts, int nverts, float &tmin, float &tmax, int &segMin, int &segMax)
 
bool dtIntersectSegSeg2D (const float *ap, const float *aq, const float *bp, const float *bq, float &s, float &t)
 
bool dtPointInPolygon (const float *pt, const float *verts, const int nverts)
 
bool dtDistancePtPolyEdgesSqr (const float *pt, const float *verts, const int nverts, float *ed, float *et)
 
float dtDistancePtSegSqr2D (const float *pt, const float *p, const float *q, float &t)
 
float dtDistancePtSegSqr (const float *pt, const float *p, const float *q)
 
void dtCalcPolyCenter (float *tc, const unsigned short *idx, int nidx, const float *verts)
 
bool dtOverlapPolyPoly2D (const float *polya, const int npolya, const float *polyb, const int npolyb)
 
Miscellanious functions.
unsigned int dtNextPow2 (unsigned int v)
 
unsigned int dtIlog2 (unsigned int v)
 
int dtAlign4 (int x)
 
int dtOppositeTile (int side)
 
void dtSwapByte (unsigned char *a, unsigned char *b)
 
void dtSwapEndian (unsigned short *v)
 
void dtSwapEndian (short *v)
 
void dtSwapEndian (unsigned int *v)
 
void dtSwapEndian (int *v)
 
void dtSwapEndian (float *v)
 
void dtRandomPointInConvexPoly (const float *pts, const int npts, float *areas, const float s, const float t, float *out)
 
Allocation Functions

Functions used to allocate and de-allocate Recast objects.

See also
rcAllocSetCustom
ATOMSUTILS_EXPORT rcHeightfieldrcAllocHeightfield ()
 
ATOMSUTILS_EXPORT void rcFreeHeightField (rcHeightfield *hf)
 
ATOMSUTILS_EXPORT rcCompactHeightfieldrcAllocCompactHeightfield ()
 
ATOMSUTILS_EXPORT void rcFreeCompactHeightfield (rcCompactHeightfield *chf)
 
ATOMSUTILS_EXPORT rcHeightfieldLayerSetrcAllocHeightfieldLayerSet ()
 
ATOMSUTILS_EXPORT void rcFreeHeightfieldLayerSet (rcHeightfieldLayerSet *lset)
 
ATOMSUTILS_EXPORT rcContourSetrcAllocContourSet ()
 
ATOMSUTILS_EXPORT void rcFreeContourSet (rcContourSet *cset)
 
ATOMSUTILS_EXPORT rcClusterSetrcAllocClusterSet ()
 
ATOMSUTILS_EXPORT void rcFreeClusterSet (rcClusterSet *clset)
 
ATOMSUTILS_EXPORT rcPolyMeshrcAllocPolyMesh ()
 
ATOMSUTILS_EXPORT void rcFreePolyMesh (rcPolyMesh *pmesh)
 
ATOMSUTILS_EXPORT rcPolyMeshDetailrcAllocPolyMeshDetail ()
 
ATOMSUTILS_EXPORT void rcFreePolyMeshDetail (rcPolyMeshDetail *dmesh)
 
Heightfield Functions
See also
rcHeightfield
ATOMSUTILS_EXPORT void rcCalcBounds (const float *verts, int nv, float *bmin, float *bmax)
 
ATOMSUTILS_EXPORT void rcCalcGridSize (const float *bmin, const float *bmax, float cs, int *w, int *h)
 
ATOMSUTILS_EXPORT bool rcCreateHeightfield (rcContext *ctx, rcHeightfield &hf, int width, int height, const float *bmin, const float *bmax, float cs, float ch)
 
ATOMSUTILS_EXPORT void rcResetHeightfield (rcHeightfield &hf)
 
ATOMSUTILS_EXPORT void rcMarkWalkableTriangles (rcContext *ctx, const float walkableSlopeAngle, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
 
ATOMSUTILS_EXPORT void rcMarkWalkableTrianglesCos (rcContext *ctx, const float walkableSlopeCos, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
 
ATOMSUTILS_EXPORT void rcClearUnwalkableTriangles (rcContext *ctx, const float walkableSlopeAngle, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
 
ATOMSUTILS_EXPORT void rcAddSpan (rcContext *ctx, rcHeightfield &hf, const int x, const int y, const unsigned short smin, const unsigned short smax, const unsigned char area, const int flagMergeThr)
 
ATOMSUTILS_EXPORT void rcAddSpans (rcContext *ctx, rcHeightfield &hf, const int flagMergeThr, const rcSpanCache *cachedSpans, const int nspans)
 
ATOMSUTILS_EXPORT int rcCountSpans (rcContext *ctx, rcHeightfield &hf)
 
ATOMSUTILS_EXPORT void rcCacheSpans (rcContext *ctx, rcHeightfield &hf, rcSpanCache *cachedSpans)
 
ATOMSUTILS_EXPORT void rcRasterizeTriangle (rcContext *ctx, const float *v0, const float *v1, const float *v2, const unsigned char area, rcHeightfield &solid, const int flagMergeThr=1)
 
ATOMSUTILS_EXPORT void rcRasterizeTriangles (rcContext *ctx, const float *verts, const int nv, const int *tris, const unsigned char *areas, const int nt, rcHeightfield &solid, const int flagMergeThr=1, const int rasterizationFlags=0)
 
ATOMSUTILS_EXPORT void rcRasterizeTriangles (rcContext *ctx, const float *verts, const int nv, const unsigned short *tris, const unsigned char *areas, const int nt, rcHeightfield &solid, const int flagMergeThr=1, const int rasterizationFlags=0)
 
ATOMSUTILS_EXPORT void rcRasterizeTriangles (rcContext *ctx, const float *verts, const unsigned char *areas, const int nt, rcHeightfield &solid, const int flagMergeThr=1)
 
ATOMSUTILS_EXPORT void rcFilterLowHangingWalkableObstacles (rcContext *ctx, const int walkableClimb, rcHeightfield &solid)
 
ATOMSUTILS_EXPORT void rcFilterLedgeSpans (rcContext *ctx, const int walkableHeight, const int walkableClimb, rcHeightfield &solid)
 
ATOMSUTILS_EXPORT void rcFilterWalkableLowHeightSpans (rcContext *ctx, int walkableHeight, rcHeightfield &solid)
 
ATOMSUTILS_EXPORT void rcFilterWalkableLowHeightSpansSequences (rcContext *ctx, int walkableHeight, rcHeightfield &solid)
 
ATOMSUTILS_EXPORT int rcGetHeightFieldSpanCount (rcContext *ctx, rcHeightfield &hf)
 
Compact Heightfield Functions
ATOMSUTILS_EXPORT bool rcBuildCompactHeightfield (rcContext *ctx, const int walkableHeight, const int walkableClimb, rcHeightfield &hf, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcErodeWalkableArea (rcContext *ctx, int radius, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcErodeWalkableAndLowAreas (rcContext *ctx, int radius, unsigned int height, unsigned char areaId, unsigned char filterFlags, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcMedianFilterWalkableArea (rcContext *ctx, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcMarkLowAreas (rcContext *ctx, unsigned int height, unsigned char areaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT void rcMarkBoxArea (rcContext *ctx, const float *bmin, const float *bmax, unsigned char areaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT void rcMarkConvexPolyArea (rcContext *ctx, const float *verts, const int nverts, const float hmin, const float hmax, unsigned char areaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT int rcOffsetPoly (const float *verts, const int nverts, const float offset, float *outVerts, const int maxOutVerts)
 
ATOMSUTILS_EXPORT void rcMarkCylinderArea (rcContext *ctx, const float *pos, const float r, const float h, unsigned char areaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT void rcReplaceBoxArea (rcContext *ctx, const float *bmin, const float *bmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT void rcReplaceConvexPolyArea (rcContext *ctx, const float *verts, const int nverts, const float hmin, const float hmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT void rcReplaceCylinderArea (rcContext *ctx, const float *pos, const float r, const float h, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcBuildDistanceField (rcContext *ctx, rcCompactHeightfield &chf)
 
ATOMSUTILS_EXPORT bool rcBuildRegions (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea)
 
ATOMSUTILS_EXPORT bool rcBuildRegionsMonotone (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea)
 
ATOMSUTILS_EXPORT bool rcBuildRegionsChunky (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea, const int chunkSize)
 
void rcSetCon (rcCompactSpan &s, int dir, int i)
 
int rcGetCon (const rcCompactSpan &s, int dir)
 
int rcGetDirOffsetX (int dir)
 
int rcGetDirOffsetY (int dir)
 
Layer, Contour, Polymesh, and Detail Mesh Functions
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayers (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
 
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayersMonotone (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
 
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayersChunky (rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, const int chunkSize, rcHeightfieldLayerSet &lset)
 
ATOMSUTILS_EXPORT bool rcBuildContours (rcContext *ctx, rcCompactHeightfield &chf, const float maxError, const int maxEdgeLen, rcContourSet &cset, const int flags=RC_CONTOUR_TESS_WALL_EDGES)
 
ATOMSUTILS_EXPORT bool rcBuildClusters (rcContext *ctx, rcContourSet &cset, rcClusterSet &clusters)
 
ATOMSUTILS_EXPORT bool rcBuildPolyMesh (rcContext *ctx, rcContourSet &cset, const int nvp, rcPolyMesh &mesh)
 
ATOMSUTILS_EXPORT bool rcMergePolyMeshes (rcContext *ctx, rcPolyMesh **meshes, const int nmeshes, rcPolyMesh &mesh)
 
ATOMSUTILS_EXPORT bool rcBuildPolyMeshDetail (rcContext *ctx, const rcPolyMesh &mesh, const rcCompactHeightfield &chf, const float sampleDist, const float sampleMaxError, rcPolyMeshDetail &dmesh)
 
ATOMSUTILS_EXPORT bool rcCopyPolyMesh (rcContext *ctx, const rcPolyMesh &src, rcPolyMesh &dst)
 
ATOMSUTILS_EXPORT bool rcMergePolyMeshDetails (rcContext *ctx, rcPolyMeshDetail **meshes, const int nmeshes, rcPolyMeshDetail &mesh)
 

Variables

class ATOMSUTILS_EXPORT JSON
 
class ATOMSUTILS_EXPORT JSONValue
 
Tile Serialization Constants

These constants are used to detect whether a navigation tile's data and state format is compatible with the current build.

Detailed Description

AtomsCore namespace.

AtomsUtils namespace.

Typedef Documentation

◆ dtAllocFunc

typedef void*() AtomsUtils::dtAllocFunc(int size, dtAllocHint hint)

A memory allocation function.

See also
dtAllocSetCustom

◆ dtFreeFunc

typedef void() AtomsUtils::dtFreeFunc(void *ptr)

A memory deallocation function.

Parameters
[in]ptrA pointer to a memory block previously allocated using dtAllocFunc.
See also
dtAllocSetCustom

◆ rcAllocFunc

typedef void*() AtomsUtils::rcAllocFunc(int size, rcAllocHint hint)

A memory allocation function.

See also
rcAllocSetCustom

◆ rcFreeFunc

typedef void() AtomsUtils::rcFreeFunc(void *ptr)

A memory deallocation function.

Parameters
[in]ptrA pointer to a memory block previously allocated using rcAllocFunc.
See also
rcAllocSetCustom

Enumeration Type Documentation

◆ dtAllocHint

Provides hint values to the memory allocator on how long the memory is expected to be used.

Enumerator
DT_ALLOC_PERM 

Memory persist after a function call.

DT_ALLOC_TEMP 

Memory used temporarily within a function.

◆ dtCompressedTileFlags

Flags for addTile.

Enumerator
DT_COMPRESSEDTILE_FREE_DATA 

Navmesh owns the tile memory and should free it.

◆ dtDetailTriEdgeFlags

Enumerator
DT_DETAIL_EDGE_BOUNDARY 

Detail triangle edge is part of the poly boundary.

◆ dtPolyTypes

Flags representing the type of a navigation mesh polygon.

Enumerator
DT_POLYTYPE_GROUND 

The polygon is a standard convex polygon that is part of the surface of the mesh.

DT_POLYTYPE_OFFMESH_POINT 

The polygon is an off-mesh connection consisting of two vertices.

DT_POLYTYPE_OFFMESH_SEGMENT 

The polygon is an off-mesh connection consisting of four vertices.

◆ dtStraightPathFlags

Vertex flags returned by dtNavMeshQuery::findStraightPath.

Enumerator
DT_STRAIGHTPATH_START 

The vertex is the start position in the path.

DT_STRAIGHTPATH_END 

The vertex is the end position in the path.

DT_STRAIGHTPATH_OFFMESH_CONNECTION 

The vertex is the start of an off-mesh connection.

◆ dtStraightPathOptions

Options for dtNavMeshQuery::findStraightPath.

Enumerator
DT_STRAIGHTPATH_AREA_CROSSINGS 

Add a vertex at every polygon edge crossing where area changes.

DT_STRAIGHTPATH_ALL_CROSSINGS 

Add a vertex at every polygon edge crossing.

◆ dtTileFlags

Tile flags used for various functions and fields. For an example, see dtNavMesh::addTile().

Enumerator
DT_TILE_FREE_DATA 

The navigation mesh owns the tile memory and is responsible for freeing it.

◆ rcAllocHint

Provides hint values to the memory allocator on how long the memory is expected to be used.

Enumerator
RC_ALLOC_PERM 

Memory will persist after a function call.

RC_ALLOC_TEMP 

Memory used temporarily within a function.

◆ rcBuildContoursFlags

Contour build flags.

See also
rcBuildContours
Enumerator
RC_CONTOUR_TESS_WALL_EDGES 

Tessellate solid (impassable) edges during contour simplification.

RC_CONTOUR_TESS_AREA_EDGES 

Tessellate edges between areas during contour simplification.

◆ rcFilterLowAreaFlags

Enumerator
RC_LOW_FILTER_SEED_SPANS 

initial seeding on spans

RC_LOW_FILTER_POST_PROCESS 

additional filtering at the end

◆ rcLogCategory

Recast log categories.

See also
rcContext
Enumerator
RC_LOG_PROGRESS 

A progress log entry.

RC_LOG_WARNING 

A warning log entry.

RC_LOG_ERROR 

An error log entry.

◆ rcRasterizationFlags

Enumerator
RC_PROJECT_TO_BOTTOM 

Will create spans from the triangle surface to the bottom of the heightfield.

◆ rcRegionPartitioning

Region partitioning methods

See also
rcConfig
Enumerator
RC_REGION_MONOTONE 

monotone partitioning

RC_REGION_WATERSHED 

watershed partitioning

RC_REGION_CHUNKY 

monotone partitioning on small chunks

◆ rcTimerLabel

Recast performance timer categories.

See also
rcContext
Enumerator
RC_TIMER_TOTAL 

The user defined total time of the build.

RC_TIMER_TEMP 

A user defined build time.

RC_TIMER_RASTERIZE_TRIANGLES 

The time to rasterize the triangles. (See: rcRasterizeTriangle)

RC_TIMER_BUILD_COMPACTHEIGHTFIELD 

The time to build the compact heightfield. (See: rcBuildCompactHeightfield)

RC_TIMER_BUILD_CONTOURS 

The total time to build the contours. (See: rcBuildContours)

RC_TIMER_BUILD_CONTOURS_TRACE 

The time to trace the boundaries of the contours. (See: rcBuildContours)

RC_TIMER_BUILD_CONTOURS_SIMPLIFY 

The time to simplify the contours. (See: rcBuildContours)

RC_TIMER_BUILD_CLUSTERS 

The time to link clusters from contours. (See: rcBuildClusters)

RC_TIMER_FILTER_BORDER 

The time to filter ledge spans. (See: rcFilterLedgeSpans)

RC_TIMER_FILTER_WALKABLE 

The time to filter low height spans. (See: rcFilterWalkableLowHeightSpans)

RC_TIMER_MEDIAN_AREA 

The time to apply the median filter. (See: rcMedianFilterWalkableArea)

RC_TIMER_FILTER_LOW_OBSTACLES 

The time to filter low obstacles. (See: rcFilterLowHangingWalkableObstacles)

RC_TIMER_BUILD_POLYMESH 

The time to build the polygon mesh. (See: rcBuildPolyMesh)

RC_TIMER_MERGE_POLYMESH 

The time to merge polygon meshes. (See: rcMergePolyMeshes)

RC_TIMER_ERODE_AREA 

The time to erode the walkable area. (See: rcErodeWalkableArea)

RC_TIMER_MARK_BOX_AREA 

The time to mark a box area. (See: rcMarkBoxArea)

RC_TIMER_MARK_CYLINDER_AREA 

The time to mark a cylinder area. (See: rcMarkCylinderArea)

RC_TIMER_MARK_CONVEXPOLY_AREA 

The time to mark a convex polygon area. (See: rcMarkConvexPolyArea)

RC_TIMER_BUILD_DISTANCEFIELD 

The total time to build the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_DISTANCEFIELD_DIST 

The time to build the distances of the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_DISTANCEFIELD_BLUR 

The time to blur the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_REGIONS 

The total time to build the regions. (See: rcBuildRegions, rcBuildRegionsMonotone)

RC_TIMER_BUILD_REGIONS_WATERSHED 

The total time to apply the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_EXPAND 

The time to expand regions while applying the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_FLOOD 

The time to flood regions while applying the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_FILTER 

The time to filter out small regions. (See: rcBuildRegions, rcBuildRegionsMonotone)

RC_TIMER_BUILD_LAYERS 

The time to build heightfield layers. (See: rcBuildHeightfieldLayers)

RC_TIMER_BUILD_POLYMESHDETAIL 

The time to build the polygon mesh detail. (See: rcBuildPolyMeshDetail)

RC_TIMER_MERGE_POLYMESHDETAIL 

The time to merge polygon mesh details. (See: rcMergePolyMeshDetails)

RC_MAX_TIMERS 

The maximum number of timers. (Used for iterating timers.)

Function Documentation

◆ dtAbs()

template<class T >
T AtomsUtils::dtAbs ( a)
inline

Returns the absolute value.

Parameters
[in]aThe value.
Returns
The absolute value of the specified value.

◆ dtAlloc()

ATOMSUTILS_EXPORT void* AtomsUtils::dtAlloc ( int  size,
dtAllocHint  hint 
)

Allocates a memory block.

Parameters
[in]sizeThe size, in bytes of memory, to allocate.
[in]hintA hint to the allocator on how long the memory is expected to be in use.
Returns
A pointer to the beginning of the allocated memory block, or null if the allocation failed.
See also
dtFree

◆ dtAllocSetCustom()

ATOMSUTILS_EXPORT void AtomsUtils::dtAllocSetCustom ( dtAllocFunc allocFunc,
dtFreeFunc freeFunc 
)

Sets the base custom allocation functions to be used by Detour.

Parameters
[in]allocFuncThe memory allocation function to be used by dtAlloc
[in]freeFuncThe memory de-allocation function to be used by dtFree

◆ dtCalcPolyCenter()

void AtomsUtils::dtCalcPolyCenter ( float *  tc,
const unsigned short *  idx,
int  nidx,
const float *  verts 
)

Derives the centroid of a convex polygon.

Parameters
[out]tcThe centroid of the polgyon. [(x, y, z)]
[in]idxThe polygon indices. [(vertIndex) * nidx]
[in]nidxThe number of indices in the polygon. [Limit: >= 3]
[in]vertsThe polygon vertices. [(x, y, z) * vertCount]

◆ dtClamp()

template<class T >
T AtomsUtils::dtClamp ( v,
mn,
mx 
)
inline

Clamps the value to the specified range.

Parameters
[in]vThe value to clamp.
[in]mnThe minimum permitted return value.
[in]mxThe maximum permitted return value.
Returns
The value, clamped to the specified range.

◆ dtClosestHeightPointTriangle()

bool AtomsUtils::dtClosestHeightPointTriangle ( const float *  p,
const float *  a,
const float *  b,
const float *  c,
float &  h 
)

Derives the y-axis height of the closest point on the triangle from the specified reference point.

Parameters
[in]pThe reference point from which to test. [(x, y, z)]
[in]aVertex A of triangle ABC. [(x, y, z)]
[in]bVertex B of triangle ABC. [(x, y, z)]
[in]cVertex C of triangle ABC. [(x, y, z)]
[out]hThe resulting height.

◆ dtClosestPtPointTriangle()

void AtomsUtils::dtClosestPtPointTriangle ( float *  closest,
const float *  p,
const float *  a,
const float *  b,
const float *  c 
)

Derives the closest point on a triangle from the specified reference point.

Parameters
[out]closestThe closest point on the triangle.
[in]pThe reference point from which to test. [(x, y, z)]
[in]aVertex A of triangle ABC. [(x, y, z)]
[in]bVertex B of triangle ABC. [(x, y, z)]
[in]cVertex C of triangle ABC. [(x, y, z)]

◆ dtFree()

ATOMSUTILS_EXPORT void AtomsUtils::dtFree ( void *  ptr)

Deallocates a memory block.

Parameters
[in]ptrA pointer to a memory block previously allocated using dtAlloc.
See also
dtAlloc

◆ dtMax()

template<class T >
T AtomsUtils::dtMax ( a,
b 
)
inline

Returns the maximum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The maximum of the two values.

◆ dtMin()

template<class T >
T AtomsUtils::dtMin ( a,
b 
)
inline

Returns the minimum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The minimum of the two values.

◆ dtNavMeshDataSwapEndian()

ATOMSUTILS_EXPORT bool AtomsUtils::dtNavMeshDataSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps endianess of the tile data.

Parameters
[in,out]dataThe tile data array.
[in]dataSizeThe size of the data array.

◆ dtNavMeshHeaderSwapEndian()

ATOMSUTILS_EXPORT bool AtomsUtils::dtNavMeshHeaderSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps the endianess of the tile data's header (#dtMeshHeader).

Parameters
[in,out]dataThe tile data array.
[in]dataSizeThe size of the data array.

◆ dtOverlapBounds()

bool AtomsUtils::dtOverlapBounds ( const float *  amin,
const float *  amax,
const float *  bmin,
const float *  bmax 
)
inline

Determines if two axis-aligned bounding boxes overlap.

Parameters
[in]aminMinimum bounds of box A. [(x, y, z)]
[in]amaxMaximum bounds of box A. [(x, y, z)]
[in]bminMinimum bounds of box B. [(x, y, z)]
[in]bmaxMaximum bounds of box B. [(x, y, z)]
Returns
True if the two AABB's overlap.
See also
dtOverlapQuantBounds

◆ dtOverlapPolyPoly2D()

bool AtomsUtils::dtOverlapPolyPoly2D ( const float *  polya,
const int  npolya,
const float *  polyb,
const int  npolyb 
)

Determines if the two convex polygons overlap on the xz-plane.

Parameters
[in]polyaPolygon A vertices. [(x, y, z) * npolya]
[in]npolyaThe number of vertices in polygon A.
[in]polybPolygon B vertices. [(x, y, z) * npolyb]
[in]npolybThe number of vertices in polygon B.
Returns
True if the two polygons overlap.

◆ dtOverlapQuantBounds()

bool AtomsUtils::dtOverlapQuantBounds ( const unsigned short  amin[3],
const unsigned short  amax[3],
const unsigned short  bmin[3],
const unsigned short  bmax[3] 
)
inline

Determines if two axis-aligned bounding boxes overlap.

Parameters
[in]aminMinimum bounds of box A. [(x, y, z)]
[in]amaxMaximum bounds of box A. [(x, y, z)]
[in]bminMinimum bounds of box B. [(x, y, z)]
[in]bmaxMaximum bounds of box B. [(x, y, z)]
Returns
True if the two AABB's overlap.
See also
dtOverlapBounds

◆ dtPointInPolygon()

bool AtomsUtils::dtPointInPolygon ( const float *  pt,
const float *  verts,
const int  nverts 
)

Determines if the specified point is inside the convex polygon on the xz-plane.

Parameters
[in]ptThe point to check. [(x, y, z)]
[in]vertsThe polygon vertices. [(x, y, z) * nverts]
[in]nvertsThe number of vertices. [Limit: >= 3]
Returns
True if the point is inside the polygon.

◆ dtSqr()

template<class T >
T AtomsUtils::dtSqr ( a)
inline

Returns the square of the value.

Parameters
[in]aThe value.
Returns
The square of the value.

◆ dtSqrt()

ATOMSUTILS_EXPORT float AtomsUtils::dtSqrt ( float  x)

Returns the square root of the value.

Parameters
[in]xThe value.
Returns
The square root of the vlaue.

◆ dtSwap()

template<class T >
void AtomsUtils::dtSwap ( T &  a,
T &  b 
)
inline

Swaps the values of the two parameters.

Parameters
[in,out]aValue A
[in,out]bValue B

◆ dtTileCacheHeaderSwapEndian()

ATOMSUTILS_EXPORT bool AtomsUtils::dtTileCacheHeaderSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps the endianess of the compressed tile data's header (#dtTileCacheLayerHeader). Tile layer data does not need endian swapping as it consist only of bytes. not anymore, there are short types as well now

Parameters
[in,out]dataThe tile data array.
[in]dataSizeThe size of the data array.

◆ dtTriArea2D()

float AtomsUtils::dtTriArea2D ( const float *  a,
const float *  b,
const float *  c 
)
inline

Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C.

Parameters
[in]aVertex A. [(x, y, z)]
[in]bVertex B. [(x, y, z)]
[in]cVertex C. [(x, y, z)]
Returns
The signed xz-plane area of the triangle.

◆ dtVadd()

void AtomsUtils::dtVadd ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector addition. (v1 + v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to add to v1. [(x, y, z)]

◆ dtVcopy()

void AtomsUtils::dtVcopy ( float *  dest,
const float *  a 
)
inline

Performs a vector copy.

Parameters
[out]destThe result. [(x, y, z)]
[in]aThe vector to copy. [(x, y, z)]

◆ dtVcross()

void AtomsUtils::dtVcross ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Derives the cross product of two vectors. (v1 x v2)

Parameters
[out]destThe cross product. [(x, y, z)]
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]

◆ dtVdist()

ATOMSUTILS_EXPORT float AtomsUtils::dtVdist ( const float *  v1,
const float *  v2 
)
inline

Returns the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The distance between the two points.

◆ dtVdist2D()

float AtomsUtils::dtVdist2D ( const float *  v1,
const float *  v2 
)
inline

Derives the distance between the specified points on the xz-plane.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The distance between the point on the xz-plane.

The vectors are projected onto the xz-plane, so the y-values are ignored.

◆ dtVdist2DSqr()

float AtomsUtils::dtVdist2DSqr ( const float *  v1,
const float *  v2 
)
inline

Derives the square of the distance between the specified points on the xz-plane.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The square of the distance between the point on the xz-plane.

◆ dtVdistSqr()

float AtomsUtils::dtVdistSqr ( const float *  v1,
const float *  v2 
)
inline

Returns the square of the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The square of the distance between the two points.

◆ dtVdot()

float AtomsUtils::dtVdot ( const float *  v1,
const float *  v2 
)
inline

Derives the dot product of two vectors. (v1 . v2)

Parameters
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]
Returns
The dot product.

◆ dtVdot2D()

float AtomsUtils::dtVdot2D ( const float *  u,
const float *  v 
)
inline

Derives the dot product of two vectors on the xz-plane. (u . v)

Parameters
[in]uA vector [(x, y, z)]
[in]vA vector [(x, y, z)]
Returns
The dot product on the xz-plane.

The vectors are projected onto the xz-plane, so the y-values are ignored.

◆ dtVequal()

bool AtomsUtils::dtVequal ( const float *  p0,
const float *  p1 
)
inline

Performs a 'sloppy' colocation check of the specified points.

Parameters
[in]p0A point. [(x, y, z)]
[in]p1A point. [(x, y, z)]
Returns
True if the points are considered to be at the same location.

Basically, this function will return true if the specified points are close enough to eachother to be considered colocated.

◆ dtVlen()

float AtomsUtils::dtVlen ( const float *  v)
inline

Derives the scalar length of the vector.

Parameters
[in]vThe vector. [(x, y, z)]
Returns
The scalar length of the vector.

◆ dtVlenSqr()

float AtomsUtils::dtVlenSqr ( const float *  v)
inline

Derives the square of the scalar length of the vector. (len * len)

Parameters
[in]vThe vector. [(x, y, z)]
Returns
The square of the scalar length of the vector.

◆ dtVlerp()

void AtomsUtils::dtVlerp ( float *  dest,
const float *  v1,
const float *  v2,
const float  t 
)
inline

Performs a linear interpolation between two vectors. (v1 toward v2)

Parameters
[out]destThe result vector. [(x, y, x)]
[in]v1The starting vector.
[in]v2The destination vector.
[in]tThe interpolation factor. [Limits: 0 <= value <= 1.0]

◆ dtVmad()

void AtomsUtils::dtVmad ( float *  dest,
const float *  v1,
const float *  v2,
const float  s 
)
inline

Performs a scaled vector addition. (v1 + (v2 * s))

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to scale and add to v1. [(x, y, z)]
[in]sThe amount to scale v2 by before adding to v1.

◆ dtVmax()

void AtomsUtils::dtVmax ( float *  mx,
const float *  v 
)
inline

Selects the maximum value of each element from the specified vectors.

Parameters
[in,out]mxA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ dtVmin()

void AtomsUtils::dtVmin ( float *  mn,
const float *  v 
)
inline

Selects the minimum value of each element from the specified vectors.

Parameters
[in,out]mnA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ dtVnormalize()

void AtomsUtils::dtVnormalize ( float *  v)
inline

Normalizes the vector.

Parameters
[in,out]vThe vector to normalize. [(x, y, z)]

◆ dtVperp2D()

float AtomsUtils::dtVperp2D ( const float *  u,
const float *  v 
)
inline

Derives the xz-plane 2D perp product of the two vectors. (uz*vx - ux*vz)

Parameters
[in]uThe LHV vector [(x, y, z)]
[in]vThe RHV vector [(x, y, z)]
Returns
The dot product on the xz-plane.

The vectors are projected onto the xz-plane, so the y-values are ignored.

◆ dtVscale()

void AtomsUtils::dtVscale ( float *  dest,
const float *  v,
const float  t 
)
inline

Scales the vector by the specified value. (v * t)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]vThe vector to scale. [(x, y, z)]
[in]tThe scaling factor.

◆ dtVset()

void AtomsUtils::dtVset ( float *  dest,
const float  x,
const float  y,
const float  z 
)
inline

Sets the vector elements to the specified values.

Parameters
[out]destThe result vector. [(x, y, z)]
[in]xThe x-value of the vector.
[in]yThe y-value of the vector.
[in]zThe z-value of the vector.

◆ dtVsub()

void AtomsUtils::dtVsub ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector subtraction. (v1 - v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to subtract from v1. [(x, y, z)]

◆ generateCurveSamples()

ATOMSUTILS_EXPORT std::vector<AtomsMath::Vector3> AtomsUtils::generateCurveSamples ( const AtomsUtils::Curve curve,
size_t  numSamples,
size_t  numPointPerSample,
double  sampleSpacing,
size_t  randNumPoint,
size_t  seed,
const AtomsMath::Vector3 &  randomSpace,
double  minDist,
const AtomsMath::Vector3 &  upVector,
const bool  returnTangentDirections,
std::vector< AtomsMath::Vector3 > &  sampleDirections 
)

Generate poisson samples.

Parameters
curveinput curve
numSamplesnumber of samples along the curve
numPointPerSamplenumber of generated samples per curve sample along the normal
sampleSpacingdistance between generated samples
randNumPointadd a random number of generated samples
seedrandom seed
randomSpacerandom space
minDistthe minimum distance between generated samples
upVectorup vector
returnTangentDirectionsreturns tangent directions instead of normal directions
sampleDirectionsdirections for the generated samples

◆ generateDartThrowSamples()

ATOMSUTILS_EXPORT std::vector<AtomsMath::Vector3> AtomsUtils::generateDartThrowSamples ( const AtomsUtils::Mesh mesh,
const AtomsMath::Matrix &  meshMatrix,
float  defaultRadius,
float  maxRadius,
size_t  seed,
size_t  numSamples,
size_t  iterations = 10000,
bool  randomizeRadius = false,
AtomsUtils::Image densityMap = nullptr,
AtomsUtils::Image eraseMap = nullptr,
double  eraseThreshold = 1.0 
)

Generate poisson samples.

Parameters
NumPointsmax number of samples
radiusDisk radius
shape0 circle, 1 square, 2 image
MinDistMinimum distance between samples
seedRandom seed
pixelsPixels of the black/white image used to reject points
numChannelsImage number of channels
imageWidthimage width
imageHeightimage height

◆ generatePoissonPoints()

ATOMSUTILS_EXPORT std::vector<AtomsMath::Vector3> AtomsUtils::generatePoissonPoints ( size_t  NumPoints,
float  radius,
int  NewPointsCount = 30,
short  shape = 0,
float  MinDist = -1.0f,
unsigned int  seed = 0,
const unsigned char *  pixels = nullptr,
short  numChannels = 3,
unsigned int  imageWidth = 0,
unsigned int  imageHeight = 0 
)

Generate poisson samples.

Parameters
NumPointsmax number of samples
radiusDisk radius
shape0 circle, 1 square, 2 image
MinDistMinimum distance between samples
seedRandom seed
pixelsPixels of the black/white image used to reject points
numChannelsImage number of channels
imageWidthimage width
imageHeightimage height

◆ rcAbs()

template<class T >
T AtomsUtils::rcAbs ( a)
inline

Returns the absolute value.

Parameters
[in]aThe value.
Returns
The absolute value of the specified value.

◆ rcAddSpan()

ATOMSUTILS_EXPORT void AtomsUtils::rcAddSpan ( rcContext ctx,
rcHeightfield hf,
const int  x,
const int  y,
const unsigned short  smin,
const unsigned short  smax,
const unsigned char  area,
const int  flagMergeThr 
)

Adds a span to the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]hfAn initialized heightfield.
[in]xThe width index where the span is to be added. [Limits: 0 <= value < rcHeightfield::width]
[in]yThe height index where the span is to be added. [Limits: 0 <= value < rcHeightfield::height]
[in]sminThe minimum height of the span. [Limit: < smax] [Units: vx]
[in]smaxThe maximum height of the span. [Limit: <= #RC_SPAN_MAX_HEIGHT] [Units: vx]
[in]areaThe area id of the span. [Limit: <= #RC_WALKABLE_AREA)
[in]flagMergeThrThe merge theshold. [Limit: >= 0] [Units: vx]

◆ rcAlloc()

void* AtomsUtils::rcAlloc ( int  size,
rcAllocHint  hint 
)

Allocates a memory block.

Parameters
[in]sizeThe size, in bytes of memory, to allocate.
[in]hintA hint to the allocator on how long the memory is expected to be in use.
Returns
A pointer to the beginning of the allocated memory block, or null if the allocation failed.
See also
rcFree

◆ rcAllocClusterSet()

ATOMSUTILS_EXPORT rcClusterSet* AtomsUtils::rcAllocClusterSet ( )

Allocates a cluster set object using the Recast allocator.

Returns
A cluster set that is ready for initialization, or null on failure.
See also
rcBuildClusters, rcFreeClusterSet

◆ rcAllocCompactHeightfield()

ATOMSUTILS_EXPORT rcCompactHeightfield* AtomsUtils::rcAllocCompactHeightfield ( )

Allocates a compact heightfield object using the Recast allocator.

Returns
A compact heightfield that is ready for initialization, or null on failure.
See also
rcBuildCompactHeightfield, rcFreeCompactHeightfield

◆ rcAllocContourSet()

ATOMSUTILS_EXPORT rcContourSet* AtomsUtils::rcAllocContourSet ( )

Allocates a contour set object using the Recast allocator.

Returns
A contour set that is ready for initialization, or null on failure.
See also
rcBuildContours, rcFreeContourSet

◆ rcAllocHeightfield()

ATOMSUTILS_EXPORT rcHeightfield* AtomsUtils::rcAllocHeightfield ( )

Allocates a heightfield object using the Recast allocator.

Returns
A heightfield that is ready for initialization, or null on failure.
See also
rcCreateHeightfield, rcFreeHeightField

◆ rcAllocHeightfieldLayerSet()

ATOMSUTILS_EXPORT rcHeightfieldLayerSet* AtomsUtils::rcAllocHeightfieldLayerSet ( )

Allocates a heightfield layer set using the Recast allocator.

Returns
A heightfield layer set that is ready for initialization, or null on failure.
See also
rcBuildHeightfieldLayers, rcFreeHeightfieldLayerSet

◆ rcAllocPolyMesh()

ATOMSUTILS_EXPORT rcPolyMesh* AtomsUtils::rcAllocPolyMesh ( )

Allocates a polygon mesh object using the Recast allocator.

Returns
A polygon mesh that is ready for initialization, or null on failure.
See also
rcBuildPolyMesh, rcFreePolyMesh

◆ rcAllocPolyMeshDetail()

ATOMSUTILS_EXPORT rcPolyMeshDetail* AtomsUtils::rcAllocPolyMeshDetail ( )

Allocates a detail mesh object using the Recast allocator.

Returns
A detail mesh that is ready for initialization, or null on failure.
See also
rcBuildPolyMeshDetail, rcFreePolyMeshDetail

◆ rcAllocSetCustom()

ATOMSUTILS_EXPORT void AtomsUtils::rcAllocSetCustom ( rcAllocFunc allocFunc,
rcFreeFunc freeFunc 
)

Sets the base custom allocation functions to be used by Recast.

Parameters
[in]allocFuncThe memory allocation function to be used by rcAlloc
[in]freeFuncThe memory de-allocation function to be used by rcFree

◆ rcBuildClusters()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildClusters ( rcContext ctx,
rcContourSet cset,
rcClusterSet clusters 
)

Builds a cluster set from contours

Parameters
[in,out]ctxThe build context to use during the operaiton
[in]csetCountour set
[out]clustersResulting cluster set

◆ rcBuildCompactHeightfield()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildCompactHeightfield ( rcContext ctx,
const int  walkableHeight,
const int  walkableClimb,
rcHeightfield hf,
rcCompactHeightfield chf 
)

Builds a compact heightfield representing open space, from a heightfield representing solid space.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[in]walkableClimbMaximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
[in]hfThe heightfield to be compacted.
[out]chfThe resulting compact heightfield. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildContours()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildContours ( rcContext ctx,
rcCompactHeightfield chf,
const float  maxError,
const int  maxEdgeLen,
rcContourSet cset,
const int  flags = RC_CONTOUR_TESS_WALL_EDGES 
)

Builds a contour set from the region outlines in the provided compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]chfA fully built compact heightfield.
[in]maxErrorThe maximum distance a simplfied contour's border edges should deviate the original raw contour. [Limit: >=0] [Units: wu]
[in]maxEdgeLenThe maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]
[out]csetThe resulting contour set. (Must be pre-allocated.)
[in]buildFlagsThe build flags. (See: rcBuildContoursFlags)
Returns
True if the operation completed successfully.

◆ rcBuildDistanceField()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildDistanceField ( rcContext ctx,
rcCompactHeightfield chf 
)

Builds the distance field for the specified compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
Returns
True if the operation completed successfully.

◆ rcBuildHeightfieldLayers()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildHeightfieldLayers ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  walkableHeight,
rcHeightfieldLayerSet lset 
)

Builds a layer set from the specified compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]chfA fully built compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[out]lsetThe resulting layer set. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildHeightfieldLayersChunky()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildHeightfieldLayersChunky ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  walkableHeight,
const int  chunkSize,
rcHeightfieldLayerSet lset 
)

Builds a layer set from the specified compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]chfA fully built compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[in]chunkSizeSize of chunk of subregion [Units: vx]
[out]lsetThe resulting layer set. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildHeightfieldLayersMonotone()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildHeightfieldLayersMonotone ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  walkableHeight,
rcHeightfieldLayerSet lset 
)

Builds a layer set from the specified compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]chfA fully built compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[out]lsetThe resulting layer set. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildPolyMesh()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildPolyMesh ( rcContext ctx,
rcContourSet cset,
const int  nvp,
rcPolyMesh mesh 
)

Builds a polygon mesh from the provided contours.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]csetA fully built contour set.
[in]nvpThe maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. [Limit: >= 3]
[out]meshThe resulting polygon mesh. (Must be re-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildPolyMeshDetail()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildPolyMeshDetail ( rcContext ctx,
const rcPolyMesh mesh,
const rcCompactHeightfield chf,
const float  sampleDist,
const float  sampleMaxError,
rcPolyMeshDetail dmesh 
)

Builds a detail mesh from the provided polygon mesh.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]meshA fully built polygon mesh.
[in]chfThe compact heightfield used to build the polygon mesh.
[in]sampleDistSets the distance to use when samping the heightfield. [Limit: >=0] [Units: wu]
[in]sampleMaxErrorThe maximum distance the detail mesh surface should deviate from heightfield data. [Limit: >=0] [Units: wu]
[out]dmeshThe resulting detail mesh. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildRegions()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildRegions ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  minRegionArea,
const int  mergeRegionArea 
)

Builds region data for the heightfield using watershed partitioning.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]minRegionAreaThe minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx].
[in]mergeRegionAreaAny regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx]
Returns
True if the operation completed successfully.

◆ rcBuildRegionsChunky()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildRegionsChunky ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  minRegionArea,
const int  mergeRegionArea,
const int  chunkSize 
)

Builds region data for the heightfield using simple monotone partitioning.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]minRegionAreaThe minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx].
[in]mergeRegionAreaAny regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx]
[in]chunkSizeSize of subregion [Units: vx]
Returns
True if the operation completed successfully.

◆ rcBuildRegionsMonotone()

ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildRegionsMonotone ( rcContext ctx,
rcCompactHeightfield chf,
const int  borderSize,
const int  minRegionArea,
const int  mergeRegionArea 
)

Builds region data for the heightfield using simple monotone partitioning.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]minRegionAreaThe minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx].
[in]mergeRegionAreaAny regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx]
Returns
True if the operation completed successfully.

◆ rcCalcBounds()

ATOMSUTILS_EXPORT void AtomsUtils::rcCalcBounds ( const float *  verts,
int  nv,
float *  bmin,
float *  bmax 
)

Calculates the bounding box of an array of vertices.

Parameters
[in]vertsAn array of vertices. [(x, y, z) * nv]
[in]nvThe number of vertices in the verts array.
[out]bminThe minimum bounds of the AABB. [(x, y, z)] [Units: wu]
[out]bmaxThe maximum bounds of the AABB. [(x, y, z)] [Units: wu]

◆ rcCalcGridSize()

ATOMSUTILS_EXPORT void AtomsUtils::rcCalcGridSize ( const float *  bmin,
const float *  bmax,
float  cs,
int *  w,
int *  h 
)

Calculates the grid size based on the bounding box and grid cell size.

Parameters
[in]bminThe minimum bounds of the AABB. [(x, y, z)] [Units: wu]
[in]bmaxThe maximum bounds of the AABB. [(x, y, z)] [Units: wu]
[in]csThe xz-plane cell size. [Limit: > 0] [Units: wu]
[out]wThe width along the x-axis. [Limit: >= 0] [Units: vx]
[out]hThe height along the z-axis. [Limit: >= 0] [Units: vx]

◆ rcClamp()

template<class T >
T AtomsUtils::rcClamp ( v,
mn,
mx 
)
inline

Clamps the value to the specified range.

Parameters
[in]vThe value to clamp.
[in]mnThe minimum permitted return value.
[in]mxThe maximum permitted return value.
Returns
The value, clamped to the specified range.

◆ rcClearUnwalkableTriangles()

ATOMSUTILS_EXPORT void AtomsUtils::rcClearUnwalkableTriangles ( rcContext ctx,
const float  walkableSlopeAngle,
const float *  verts,
int  nv,
const int *  tris,
int  nt,
unsigned char *  areas 
)

Sets the area id of all triangles with a slope greater than or equal to the specified value to #RC_NULL_AREA.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableSlopeAngleThe maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]
[in]vertsThe vertices. [(x, y, z) * nv]
[in]nvThe number of vertices.
[in]trisThe triangle vertex indices. [(vertA, vertB, vertC) * nt]
[in]ntThe number of triangles.
[out]areasThe triangle area ids. [Length: >= nt]

◆ rcCopyPolyMesh()

ATOMSUTILS_EXPORT bool AtomsUtils::rcCopyPolyMesh ( rcContext ctx,
const rcPolyMesh src,
rcPolyMesh dst 
)

Copies the poly mesh data from src to dst.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]srcThe source mesh to copy from.
[out]dstThe resulting detail mesh. (Must be pre-allocated, must be empty mesh.)
Returns
True if the operation completed successfully.

◆ rcCreateHeightfield()

ATOMSUTILS_EXPORT bool AtomsUtils::rcCreateHeightfield ( rcContext ctx,
rcHeightfield hf,
int  width,
int  height,
const float *  bmin,
const float *  bmax,
float  cs,
float  ch 
)

Initializes a new heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]hfThe allocated heightfield to initialize.
[in]widthThe width of the field along the x-axis. [Limit: >= 0] [Units: vx]
[in]heightThe height of the field along the z-axis. [Limit: >= 0] [Units: vx]
[in]bminThe minimum bounds of the field's AABB. [(x, y, z)] [Units: wu]
[in]bmaxThe maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
[in]csThe xz-plane cell size to use for the field. [Limit: > 0] [Units: wu]
[in]chThe y-axis cell size to use for field. [Limit: > 0] [Units: wu]

◆ rcErodeWalkableAndLowAreas()

ATOMSUTILS_EXPORT bool AtomsUtils::rcErodeWalkableAndLowAreas ( rcContext ctx,
int  radius,
unsigned int  height,
unsigned char  areaId,
unsigned char  filterFlags,
rcCompactHeightfield chf 
)

Erodes the walkable area within the heightfield by the specified radius. Additionally, it will mark all spans that are too low (rcMarkLowAreas)

Parameters
[in,out]ctxThe build context to use during the operation.
[in]radiusThe radius of erosion. [Limits: 0 < value < 255] [Units: vx]
[in]heightHeight threshold [Units: vx]
[in]areaIdThe area id to apply [Limit: <= @RC_WALKABLE_AREA]
[in]filterFlagsSee: rcFilterLowAreaFlags
[in,out]chfThe populated compact heightfield to erode.
Returns
True if the operation completed successfully.

◆ rcErodeWalkableArea()

ATOMSUTILS_EXPORT bool AtomsUtils::rcErodeWalkableArea ( rcContext ctx,
int  radius,
rcCompactHeightfield chf 
)

Erodes the walkable area within the heightfield by the specified radius.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]radiusThe radius of erosion. [Limits: 0 < value < 255] [Units: vx]
[in,out]chfThe populated compact heightfield to erode.
Returns
True if the operation completed successfully.

◆ rcFilterLedgeSpans()

ATOMSUTILS_EXPORT void AtomsUtils::rcFilterLedgeSpans ( rcContext ctx,
const int  walkableHeight,
const int  walkableClimb,
rcHeightfield solid 
)

Marks spans that are ledges as not-walkable.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[in]walkableClimbMaximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
[in,out]solidA fully built heightfield. (All spans have been added.)

◆ rcFilterLowHangingWalkableObstacles()

ATOMSUTILS_EXPORT void AtomsUtils::rcFilterLowHangingWalkableObstacles ( rcContext ctx,
const int  walkableClimb,
rcHeightfield solid 
)

Marks non-walkable spans as walkable if their maximum is within walkableClimp of a walkable neighbor.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableClimbMaximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
[in,out]solidA fully built heightfield. (All spans have been added.)

◆ rcFilterWalkableLowHeightSpans()

ATOMSUTILS_EXPORT void AtomsUtils::rcFilterWalkableLowHeightSpans ( rcContext ctx,
int  walkableHeight,
rcHeightfield solid 
)

Marks walkable spans as not walkable if the clearance above the span is less than the specified height.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[in,out]solidA fully built heightfield. (All spans have been added.)

◆ rcFree()

void AtomsUtils::rcFree ( void *  ptr)

Deallocates a memory block.

Parameters
[in]ptrA pointer to a memory block previously allocated using rcAlloc.
See also
rcAlloc

◆ rcFreeClusterSet()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreeClusterSet ( rcClusterSet clset)

Frees the specified cluster set using the Recast allocator.

Parameters
[in]clsetA cluster set allocated using rcAllocClusterSet
See also
rcAllocClusterSet

◆ rcFreeCompactHeightfield()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreeCompactHeightfield ( rcCompactHeightfield chf)

Frees the specified compact heightfield object using the Recast allocator.

Parameters
[in]chfA compact heightfield allocated using rcAllocCompactHeightfield
See also
rcAllocCompactHeightfield

◆ rcFreeContourSet()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreeContourSet ( rcContourSet cset)

Frees the specified contour set using the Recast allocator.

Parameters
[in]csetA contour set allocated using rcAllocContourSet
See also
rcAllocContourSet

◆ rcFreeHeightField()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreeHeightField ( rcHeightfield hf)

Frees the specified heightfield object using the Recast allocator.

Parameters
[in]hfA heightfield allocated using rcAllocHeightfield
See also
rcAllocHeightfield

◆ rcFreeHeightfieldLayerSet()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreeHeightfieldLayerSet ( rcHeightfieldLayerSet lset)

Frees the specified heightfield layer set using the Recast allocator.

Parameters
[in]lsetA heightfield layer set allocated using rcAllocHeightfieldLayerSet
See also
rcAllocHeightfieldLayerSet

◆ rcFreePolyMesh()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreePolyMesh ( rcPolyMesh pmesh)

Frees the specified polygon mesh using the Recast allocator.

Parameters
[in]pmeshA polygon mesh allocated using rcAllocPolyMesh
See also
rcAllocPolyMesh

◆ rcFreePolyMeshDetail()

ATOMSUTILS_EXPORT void AtomsUtils::rcFreePolyMeshDetail ( rcPolyMeshDetail dmesh)

Frees the specified detail mesh using the Recast allocator.

Parameters
[in]dmeshA detail mesh allocated using rcAllocPolyMeshDetail
See also
rcAllocPolyMeshDetail

◆ rcGetCon()

int AtomsUtils::rcGetCon ( const rcCompactSpan s,
int  dir 
)
inline

Gets neighbor connection data for the specified direction.

Parameters
[in]sThe span to check.
[in]dirThe direction to check. [Limits: 0 <= value < 4]
Returns
The neighbor connection data for the specified direction, or #RC_NOT_CONNECTED if there is no connection.

◆ rcGetDirOffsetX()

int AtomsUtils::rcGetDirOffsetX ( int  dir)
inline

Gets the standard width (x-axis) offset for the specified direction.

Parameters
[in]dirThe direction. [Limits: 0 <= value < 4]
Returns
The width offset to apply to the current cell position to move in the direction.

◆ rcGetDirOffsetY()

int AtomsUtils::rcGetDirOffsetY ( int  dir)
inline

Gets the standard height (z-axis) offset for the specified direction.

Parameters
[in]dirThe direction. [Limits: 0 <= value < 4]
Returns
The height offset to apply to the current cell position to move in the direction.

◆ rcGetHeightFieldSpanCount()

ATOMSUTILS_EXPORT int AtomsUtils::rcGetHeightFieldSpanCount ( rcContext ctx,
rcHeightfield hf 
)

Returns the number of spans contained in the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]hfAn initialized heightfield.
Returns
The number of spans in the heightfield.

◆ rcMarkBoxArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcMarkBoxArea ( rcContext ctx,
const float *  bmin,
const float *  bmax,
unsigned char  areaId,
rcCompactHeightfield chf 
)

Applies an area id to all spans within the specified bounding box. (AABB)

Parameters
[in,out]ctxThe build context to use during the operation.
[in]bminThe minimum of the bounding box. [(x, y, z)]
[in]bmaxThe maximum of the bounding box. [(x, y, z)]
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcMarkConvexPolyArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcMarkConvexPolyArea ( rcContext ctx,
const float *  verts,
const int  nverts,
const float  hmin,
const float  hmax,
unsigned char  areaId,
rcCompactHeightfield chf 
)

Applies the area id to the all spans within the specified convex polygon.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]vertsThe vertices of the polygon [Fomr: (x, y, z) * nverts]
[in]nvertsThe number of vertices in the polygon.
[in]hminThe height of the base of the polygon.
[in]hmaxThe height of the top of the polygon.
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcMarkCylinderArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcMarkCylinderArea ( rcContext ctx,
const float *  pos,
const float  r,
const float  h,
unsigned char  areaId,
rcCompactHeightfield chf 
)

Applies the area id to all spans within the specified cylinder.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]posThe center of the base of the cylinder. [Form: (x, y, z)]
[in]rThe radius of the cylinder.
[in]hThe height of the cylinder.
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcMarkLowAreas()

ATOMSUTILS_EXPORT bool AtomsUtils::rcMarkLowAreas ( rcContext ctx,
unsigned int  height,
unsigned char  areaId,
rcCompactHeightfield chf 
)

Marks all spans that have insufficient free space above

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
[in]heightHeight threshold [Units: vx]
[in]areaIdThe area id to apply [Limit: <= @RC_WALKABLE_AREA]
Returns
True if the operation completed successfully.

◆ rcMarkWalkableTriangles()

ATOMSUTILS_EXPORT void AtomsUtils::rcMarkWalkableTriangles ( rcContext ctx,
const float  walkableSlopeAngle,
const float *  verts,
int  nv,
const int *  tris,
int  nt,
unsigned char *  areas 
)

Sets the area id of all triangles with a slope below the specified value to #RC_WALKABLE_AREA.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableSlopeAngleThe maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]
[in]vertsThe vertices. [(x, y, z) * nv]
[in]nvThe number of vertices.
[in]trisThe triangle vertex indices. [(vertA, vertB, vertC) * nt]
[in]ntThe number of triangles.
[out]areasThe triangle area ids. [Length: >= nt]

◆ rcMarkWalkableTrianglesCos()

ATOMSUTILS_EXPORT void AtomsUtils::rcMarkWalkableTrianglesCos ( rcContext ctx,
const float  walkableSlopeCos,
const float *  verts,
int  nv,
const int *  tris,
int  nt,
unsigned char *  areas 
)

Sets the area id of all triangles with a slope below the specified value to #RC_WALKABLE_AREA.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]walkableSlopeCosThe cosine of maximum slope that is considered walkable. [Limits: 0 <= value < 1]
[in]vertsThe vertices. [(x, y, z) * nv]
[in]nvThe number of vertices.
[in]trisThe triangle vertex indices. [(vertA, vertB, vertC) * nt]
[in]ntThe number of triangles.
[out]areasThe triangle area ids. [Length: >= nt]

◆ rcMax()

template<class T >
T AtomsUtils::rcMax ( a,
b 
)
inline

Returns the maximum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The maximum of the two values.

◆ rcMedianFilterWalkableArea()

ATOMSUTILS_EXPORT bool AtomsUtils::rcMedianFilterWalkableArea ( rcContext ctx,
rcCompactHeightfield chf 
)

Applies a median filter to walkable area types (based on area id), removing noise.

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
Returns
True if the operation completed successfully.

◆ rcMergePolyMeshDetails()

ATOMSUTILS_EXPORT bool AtomsUtils::rcMergePolyMeshDetails ( rcContext ctx,
rcPolyMeshDetail **  meshes,
const int  nmeshes,
rcPolyMeshDetail mesh 
)

Merges multiple detail meshes into a single detail mesh.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]meshesAn array of detail meshes to merge. [Size: nmeshes]
[in]nmeshesThe number of detail meshes in the meshes array.
[out]meshThe resulting detail mesh. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcMergePolyMeshes()

ATOMSUTILS_EXPORT bool AtomsUtils::rcMergePolyMeshes ( rcContext ctx,
rcPolyMesh **  meshes,
const int  nmeshes,
rcPolyMesh mesh 
)

Merges multiple polygon meshes into a single mesh.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]meshesAn array of polygon meshes to merge. [Size: nmeshes]
[in]nmeshesThe number of polygon meshes in the meshes array.
[in]meshThe resulting polygon mesh. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcMin()

template<class T >
T AtomsUtils::rcMin ( a,
b 
)
inline

Returns the minimum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The minimum of the two values.

◆ rcOffsetPoly()

ATOMSUTILS_EXPORT int AtomsUtils::rcOffsetPoly ( const float *  verts,
const int  nverts,
const float  offset,
float *  outVerts,
const int  maxOutVerts 
)

Helper function to offset voncex polygons for rcMarkConvexPolyArea.

Parameters
[in]vertsThe vertices of the polygon [Form: (x, y, z) * nverts]
[in]nvertsThe number of vertices in the polygon.
[out]outVertsThe offset vertices (should hold up to 2 * nverts) [Form: (x, y, z) * return value]
[in]maxOutVertsThe max number of vertices that can be stored to outVerts.
Returns
Number of vertices in the offset polygon or 0 if too few vertices in outVerts.

◆ rcRasterizeTriangle()

ATOMSUTILS_EXPORT void AtomsUtils::rcRasterizeTriangle ( rcContext ctx,
const float *  v0,
const float *  v1,
const float *  v2,
const unsigned char  area,
rcHeightfield solid,
const int  flagMergeThr = 1 
)

Rasterizes a triangle into the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]v0Triangle vertex 0 [(x, y, z)]
[in]v1Triangle vertex 1 [(x, y, z)]
[in]v2Triangle vertex 2 [(x, y, z)]
[in]areaThe area id of the triangle. [Limit: <= #RC_WALKABLE_AREA]
[in,out]solidAn initialized heightfield.
[in]flagMergeThrThe distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx]

◆ rcRasterizeTriangles() [1/3]

ATOMSUTILS_EXPORT void AtomsUtils::rcRasterizeTriangles ( rcContext ctx,
const float *  verts,
const int  nv,
const int *  tris,
const unsigned char *  areas,
const int  nt,
rcHeightfield solid,
const int  flagMergeThr = 1,
const int  rasterizationFlags = 0 
)

Rasterizes an indexed triangle mesh into the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]vertsThe vertices. [(x, y, z) * nv]
[in]nvThe number of vertices.
[in]trisThe triangle indices. [(vertA, vertB, vertC) * nt]
[in]areasThe area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt]
[in]ntThe number of triangles.
[in,out]solidAn initialized heightfield.
[in]flagMergeThrThe distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx]
[in]intFlags to change the rasterization behavior

◆ rcRasterizeTriangles() [2/3]

ATOMSUTILS_EXPORT void AtomsUtils::rcRasterizeTriangles ( rcContext ctx,
const float *  verts,
const int  nv,
const unsigned short *  tris,
const unsigned char *  areas,
const int  nt,
rcHeightfield solid,
const int  flagMergeThr = 1,
const int  rasterizationFlags = 0 
)

Rasterizes an indexed triangle mesh into the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]vertsThe vertices. [(x, y, z) * nv]
[in]nvThe number of vertices.
[in]trisThe triangle indices. [(vertA, vertB, vertC) * nt]
[in]areasThe area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt]
[in]ntThe number of triangles.
[in,out]solidAn initialized heightfield.
[in]flagMergeThrThe distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx]
[in]intFlags to change the rasterization behavior

◆ rcRasterizeTriangles() [3/3]

ATOMSUTILS_EXPORT void AtomsUtils::rcRasterizeTriangles ( rcContext ctx,
const float *  verts,
const unsigned char *  areas,
const int  nt,
rcHeightfield solid,
const int  flagMergeThr = 1 
)

Rasterizes triangles into the specified heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]vertsThe triangle vertices. [(ax, ay, az, bx, by, bz, cx, by, cx) * nt]
[in]areasThe area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt]
[in]ntThe number of triangles.
[in,out]solidAn initialized heightfield.
[in]flagMergeThrThe distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx]

◆ rcReplaceBoxArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcReplaceBoxArea ( rcContext ctx,
const float *  bmin,
const float *  bmax,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

Replaces an area id in spans with matching filter area within the specified bounding box. (AABB)

Parameters
[in,out]ctxThe build context to use during the operation.
[in]bminThe minimum of the bounding box. [(x, y, z)]
[in]bmaxThe maximum of the bounding box. [(x, y, z)]
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcReplaceConvexPolyArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcReplaceConvexPolyArea ( rcContext ctx,
const float *  verts,
const int  nverts,
const float  hmin,
const float  hmax,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

Replaces an area id in spans with matching filter area within the specified convex polygon.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]vertsThe vertices of the polygon [Fomr: (x, y, z) * nverts]
[in]nvertsThe number of vertices in the polygon.
[in]hminThe height of the base of the polygon.
[in]hmaxThe height of the top of the polygon.
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcReplaceCylinderArea()

ATOMSUTILS_EXPORT void AtomsUtils::rcReplaceCylinderArea ( rcContext ctx,
const float *  pos,
const float  r,
const float  h,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

Replaces an area id in spans with matching filter area within the specified cylinder.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]posThe center of the base of the cylinder. [Form: (x, y, z)]
[in]rThe radius of the cylinder.
[in]hThe height of the cylinder.
[in]areaIdThe area id to apply. [Limit: <= #RC_WALKABLE_AREA]
[in,out]chfA populated compact heightfield.

◆ rcResetHeightfield()

ATOMSUTILS_EXPORT void AtomsUtils::rcResetHeightfield ( rcHeightfield hf)

Resets all spans of heightfield.

Parameters
[in,out]hfThe heightfield to reset.
[in]bminThe minimum bounds of the field's AABB. [(x, y, z)] [Units: wu]
[in]bmaxThe maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
[in,out]hfThe heightfield toreset.

◆ rcSetCon()

void AtomsUtils::rcSetCon ( rcCompactSpan s,
int  dir,
int  i 
)
inline

Sets the neighbor connection data for the specified direction.

Parameters
[in]sThe span to update.
[in]dirThe direction to set. [Limits: 0 <= value < 4]
[in]iThe index of the neighbor span.

◆ rcSqr()

template<class T >
T AtomsUtils::rcSqr ( a)
inline

Returns the square of the value.

Parameters
[in]aThe value.
Returns
The square of the value.

◆ rcSqrt()

float AtomsUtils::rcSqrt ( float  x)

Returns the square root of the value.

Parameters
[in]xThe value.
Returns
The square root of the vlaue.

◆ rcSwap()

template<class T >
void AtomsUtils::rcSwap ( T &  a,
T &  b 
)
inline

Swaps the values of the two parameters.

Parameters
[in,out]aValue A
[in,out]bValue B

◆ rcVadd()

void AtomsUtils::rcVadd ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector addition. (v1 + v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to add to v1. [(x, y, z)]

◆ rcVcopy()

void AtomsUtils::rcVcopy ( float *  dest,
const float *  v 
)
inline

Performs a vector copy.

Parameters
[out]destThe result. [(x, y, z)]
[in]vThe vector to copy. [(x, y, z)]

◆ rcVcross()

void AtomsUtils::rcVcross ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Derives the cross product of two vectors. (v1 x v2)

Parameters
[out]destThe cross product. [(x, y, z)]
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]

◆ rcVdist()

float AtomsUtils::rcVdist ( const float *  v1,
const float *  v2 
)
inline

Returns the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The distance between the two points.

◆ rcVdistSqr()

float AtomsUtils::rcVdistSqr ( const float *  v1,
const float *  v2 
)
inline

Returns the square of the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The square of the distance between the two points.

◆ rcVdot()

float AtomsUtils::rcVdot ( const float *  v1,
const float *  v2 
)
inline

Derives the dot product of two vectors. (v1 . v2)

Parameters
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]
Returns
The dot product.

◆ rcVmad()

void AtomsUtils::rcVmad ( float *  dest,
const float *  v1,
const float *  v2,
const float  s 
)
inline

Performs a scaled vector addition. (v1 + (v2 * s))

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to scale and add to v1. [(x, y, z)]
[in]sThe amount to scale v2 by before adding to v1.

◆ rcVmax()

void AtomsUtils::rcVmax ( float *  mx,
const float *  v 
)
inline

Selects the maximum value of each element from the specified vectors.

Parameters
[in,out]mxA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ rcVmin()

void AtomsUtils::rcVmin ( float *  mn,
const float *  v 
)
inline

Selects the minimum value of each element from the specified vectors.

Parameters
[in,out]mnA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ rcVnormalize()

void AtomsUtils::rcVnormalize ( float *  v)
inline

Normalizes the vector.

Parameters
[in,out]vThe vector to normalize. [(x, y, z)]

◆ rcVsub()

void AtomsUtils::rcVsub ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector subtraction. (v1 - v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to subtract from v1. [(x, y, z)]

◆ sphereRayIntersect()

ATOMSUTILS_EXPORT bool AtomsUtils::sphereRayIntersect ( const AtomsMath::Vector3 &  dir,
const AtomsMath::Vector3 &  orig,
const AtomsMath::Vector3 &  center,
const double  radius,
double &  t0,
double &  t1 
)

Sphere ray intersector.

Parameters
dirRay direction
origRay origin
centerSphere center
radiusSphere radius
t0First intersection (parametric coordinate)
t1Second intersection (parametric coordinate)
Returns
True if there is at least one intersection