Atoms Crowd
7.0.0
|
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< BoxEdge > | v_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) |
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 ¢er, 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 dtNavMesh * | dtAllocNavMesh () |
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 dtNavMeshQuery * | dtAllocNavMeshQuery () |
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 dtTileCache * | dtAllocTileCache () |
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 dtTileCacheContourSet * | dtAllocTileCacheContourSet (dtTileCacheAlloc *alloc) |
ATOMSUTILS_EXPORT void | dtFreeTileCacheContourSet (dtTileCacheAlloc *alloc, dtTileCacheContourSet *cset) |
ATOMSUTILS_EXPORT dtTileCacheClusterSet * | dtAllocTileCacheClusterSet (dtTileCacheAlloc *alloc) |
ATOMSUTILS_EXPORT void | dtFreeTileCacheClusterSet (dtTileCacheAlloc *alloc, dtTileCacheClusterSet *clusters) |
ATOMSUTILS_EXPORT dtTileCachePolyMesh * | dtAllocTileCachePolyMesh (dtTileCacheAlloc *alloc) |
ATOMSUTILS_EXPORT void | dtFreeTileCachePolyMesh (dtTileCacheAlloc *alloc, dtTileCachePolyMesh *lmesh) |
ATOMSUTILS_EXPORT dtTileCachePolyMeshDetail * | dtAllocTileCachePolyMeshDetail (dtTileCacheAlloc *alloc) |
ATOMSUTILS_EXPORT void | dtFreeTileCachePolyMeshDetail (dtTileCacheAlloc *alloc, dtTileCachePolyMeshDetail *dmesh) |
ATOMSUTILS_EXPORT dtTileCacheDistanceField * | dtAllocTileCacheDistanceField (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 > | |
T | dtMin (T a, T b) |
template<class T > | |
T | dtMax (T a, T b) |
template<class T > | |
T | dtAbs (T a) |
template<class T > | |
T | dtSqr (T a) |
template<class T > | |
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 > | |
T | rcMin (T a, T b) |
template<class T > | |
T | rcMax (T a, T b) |
template<class T > | |
T | rcAbs (T a) |
template<class T > | |
T | rcSqr (T a) |
template<class T > | |
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.
| |
ATOMSUTILS_EXPORT rcHeightfield * | rcAllocHeightfield () |
ATOMSUTILS_EXPORT void | rcFreeHeightField (rcHeightfield *hf) |
ATOMSUTILS_EXPORT rcCompactHeightfield * | rcAllocCompactHeightfield () |
ATOMSUTILS_EXPORT void | rcFreeCompactHeightfield (rcCompactHeightfield *chf) |
ATOMSUTILS_EXPORT rcHeightfieldLayerSet * | rcAllocHeightfieldLayerSet () |
ATOMSUTILS_EXPORT void | rcFreeHeightfieldLayerSet (rcHeightfieldLayerSet *lset) |
ATOMSUTILS_EXPORT rcContourSet * | rcAllocContourSet () |
ATOMSUTILS_EXPORT void | rcFreeContourSet (rcContourSet *cset) |
ATOMSUTILS_EXPORT rcClusterSet * | rcAllocClusterSet () |
ATOMSUTILS_EXPORT void | rcFreeClusterSet (rcClusterSet *clset) |
ATOMSUTILS_EXPORT rcPolyMesh * | rcAllocPolyMesh () |
ATOMSUTILS_EXPORT void | rcFreePolyMesh (rcPolyMesh *pmesh) |
ATOMSUTILS_EXPORT rcPolyMeshDetail * | rcAllocPolyMeshDetail () |
ATOMSUTILS_EXPORT void | rcFreePolyMeshDetail (rcPolyMeshDetail *dmesh) |
Heightfield Functions | |
| |
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) |
AtomsCore namespace.
AtomsUtils namespace.
typedef void*() AtomsUtils::dtAllocFunc(int size, dtAllocHint hint) |
A memory allocation function.
typedef void() AtomsUtils::dtFreeFunc(void *ptr) |
A memory deallocation function.
[in] | ptr | A pointer to a memory block previously allocated using dtAllocFunc. |
typedef void*() AtomsUtils::rcAllocFunc(int size, rcAllocHint hint) |
A memory allocation function.
typedef void() AtomsUtils::rcFreeFunc(void *ptr) |
A memory deallocation function.
[in] | ptr | A pointer to a memory block previously allocated using rcAllocFunc. |
Flags representing the type of a navigation mesh polygon.
Vertex flags returned by dtNavMeshQuery::findStraightPath.
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. |
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. |
Contour build flags.
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. |
Recast log categories.
Enumerator | |
---|---|
RC_LOG_PROGRESS | A progress log entry. |
RC_LOG_WARNING | A warning log entry. |
RC_LOG_ERROR | An error log entry. |
Region partitioning methods
Enumerator | |
---|---|
RC_REGION_MONOTONE | monotone partitioning |
RC_REGION_WATERSHED | watershed partitioning |
RC_REGION_CHUNKY | monotone partitioning on small chunks |
Recast performance timer categories.
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.) |
|
inline |
Returns the absolute value.
[in] | a | The value. |
ATOMSUTILS_EXPORT void* AtomsUtils::dtAlloc | ( | int | size, |
dtAllocHint | hint | ||
) |
Allocates a memory block.
[in] | size | The size, in bytes of memory, to allocate. |
[in] | hint | A hint to the allocator on how long the memory is expected to be in use. |
ATOMSUTILS_EXPORT void AtomsUtils::dtAllocSetCustom | ( | dtAllocFunc * | allocFunc, |
dtFreeFunc * | freeFunc | ||
) |
void AtomsUtils::dtCalcPolyCenter | ( | float * | tc, |
const unsigned short * | idx, | ||
int | nidx, | ||
const float * | verts | ||
) |
Derives the centroid of a convex polygon.
[out] | tc | The centroid of the polgyon. [(x, y, z)] |
[in] | idx | The polygon indices. [(vertIndex) * nidx ] |
[in] | nidx | The number of indices in the polygon. [Limit: >= 3] |
[in] | verts | The polygon vertices. [(x, y, z) * vertCount] |
|
inline |
Clamps the value to the specified range.
[in] | v | The value to clamp. |
[in] | mn | The minimum permitted return value. |
[in] | mx | The maximum permitted return value. |
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.
[in] | p | The reference point from which to test. [(x, y, z)] |
[in] | a | Vertex A of triangle ABC. [(x, y, z)] |
[in] | b | Vertex B of triangle ABC. [(x, y, z)] |
[in] | c | Vertex C of triangle ABC. [(x, y, z)] |
[out] | h | The resulting height. |
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.
[out] | closest | The closest point on the triangle. |
[in] | p | The reference point from which to test. [(x, y, z)] |
[in] | a | Vertex A of triangle ABC. [(x, y, z)] |
[in] | b | Vertex B of triangle ABC. [(x, y, z)] |
[in] | c | Vertex C of triangle ABC. [(x, y, z)] |
ATOMSUTILS_EXPORT void AtomsUtils::dtFree | ( | void * | ptr | ) |
|
inline |
Returns the maximum of two values.
[in] | a | Value A |
[in] | b | Value B |
|
inline |
Returns the minimum of two values.
[in] | a | Value A |
[in] | b | Value B |
ATOMSUTILS_EXPORT bool AtomsUtils::dtNavMeshDataSwapEndian | ( | unsigned char * | data, |
const int | dataSize | ||
) |
Swaps endianess of the tile data.
[in,out] | data | The tile data array. |
[in] | dataSize | The size of the data array. |
ATOMSUTILS_EXPORT bool AtomsUtils::dtNavMeshHeaderSwapEndian | ( | unsigned char * | data, |
const int | dataSize | ||
) |
Swaps the endianess of the tile data's header (#dtMeshHeader).
[in,out] | data | The tile data array. |
[in] | dataSize | The size of the data array. |
|
inline |
Determines if two axis-aligned bounding boxes overlap.
[in] | amin | Minimum bounds of box A. [(x, y, z)] |
[in] | amax | Maximum bounds of box A. [(x, y, z)] |
[in] | bmin | Minimum bounds of box B. [(x, y, z)] |
[in] | bmax | Maximum bounds of box B. [(x, y, z)] |
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.
[in] | polya | Polygon A vertices. [(x, y, z) * npolya ] |
[in] | npolya | The number of vertices in polygon A. |
[in] | polyb | Polygon B vertices. [(x, y, z) * npolyb ] |
[in] | npolyb | The number of vertices in polygon B. |
|
inline |
Determines if two axis-aligned bounding boxes overlap.
[in] | amin | Minimum bounds of box A. [(x, y, z)] |
[in] | amax | Maximum bounds of box A. [(x, y, z)] |
[in] | bmin | Minimum bounds of box B. [(x, y, z)] |
[in] | bmax | Maximum bounds of box B. [(x, y, z)] |
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.
[in] | pt | The point to check. [(x, y, z)] |
[in] | verts | The polygon vertices. [(x, y, z) * nverts ] |
[in] | nverts | The number of vertices. [Limit: >= 3] |
|
inline |
Returns the square of the value.
[in] | a | The value. |
ATOMSUTILS_EXPORT float AtomsUtils::dtSqrt | ( | float | x | ) |
Returns the square root of the value.
[in] | x | The value. |
|
inline |
Swaps the values of the two parameters.
[in,out] | a | Value A |
[in,out] | b | Value B |
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
[in,out] | data | The tile data array. |
[in] | dataSize | The size of the data array. |
|
inline |
Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C.
[in] | a | Vertex A. [(x, y, z)] |
[in] | b | Vertex B. [(x, y, z)] |
[in] | c | Vertex C. [(x, y, z)] |
|
inline |
Performs a vector addition. (v1
+ v2
)
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to add to v1 . [(x, y, z)] |
|
inline |
Performs a vector copy.
[out] | dest | The result. [(x, y, z)] |
[in] | a | The vector to copy. [(x, y, z)] |
|
inline |
Derives the cross product of two vectors. (v1
x v2
)
[out] | dest | The cross product. [(x, y, z)] |
[in] | v1 | A Vector [(x, y, z)] |
[in] | v2 | A vector [(x, y, z)] |
|
inline |
Returns the distance between two points.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
|
inline |
Derives the distance between the specified points on the xz-plane.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
The vectors are projected onto the xz-plane, so the y-values are ignored.
|
inline |
Derives the square of the distance between the specified points on the xz-plane.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
|
inline |
Returns the square of the distance between two points.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
|
inline |
Derives the dot product of two vectors. (v1
. v2
)
[in] | v1 | A Vector [(x, y, z)] |
[in] | v2 | A vector [(x, y, z)] |
|
inline |
Derives the dot product of two vectors on the xz-plane. (u
. v
)
[in] | u | A vector [(x, y, z)] |
[in] | v | A vector [(x, y, z)] |
The vectors are projected onto the xz-plane, so the y-values are ignored.
|
inline |
Performs a 'sloppy' colocation check of the specified points.
[in] | p0 | A point. [(x, y, z)] |
[in] | p1 | A point. [(x, y, z)] |
Basically, this function will return true if the specified points are close enough to eachother to be considered colocated.
|
inline |
Derives the scalar length of the vector.
[in] | v | The vector. [(x, y, z)] |
|
inline |
Derives the square of the scalar length of the vector. (len * len)
[in] | v | The vector. [(x, y, z)] |
|
inline |
Performs a linear interpolation between two vectors. (v1
toward v2
)
[out] | dest | The result vector. [(x, y, x)] |
[in] | v1 | The starting vector. |
[in] | v2 | The destination vector. |
[in] | t | The interpolation factor. [Limits: 0 <= value <= 1.0] |
|
inline |
Performs a scaled vector addition. (v1
+ (v2
* s
))
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to scale and add to v1 . [(x, y, z)] |
[in] | s | The amount to scale v2 by before adding to v1 . |
|
inline |
Selects the maximum value of each element from the specified vectors.
[in,out] | mx | A vector. (Will be updated with the result.) [(x, y, z)] |
[in] | v | A vector. [(x, y, z)] |
|
inline |
Selects the minimum value of each element from the specified vectors.
[in,out] | mn | A vector. (Will be updated with the result.) [(x, y, z)] |
[in] | v | A vector. [(x, y, z)] |
|
inline |
Normalizes the vector.
[in,out] | v | The vector to normalize. [(x, y, z)] |
|
inline |
Derives the xz-plane 2D perp product of the two vectors. (uz*vx - ux*vz)
[in] | u | The LHV vector [(x, y, z)] |
[in] | v | The RHV vector [(x, y, z)] |
The vectors are projected onto the xz-plane, so the y-values are ignored.
|
inline |
Scales the vector by the specified value. (v
* t
)
[out] | dest | The result vector. [(x, y, z)] |
[in] | v | The vector to scale. [(x, y, z)] |
[in] | t | The scaling factor. |
|
inline |
Sets the vector elements to the specified values.
[out] | dest | The result vector. [(x, y, z)] |
[in] | x | The x-value of the vector. |
[in] | y | The y-value of the vector. |
[in] | z | The z-value of the vector. |
|
inline |
Performs a vector subtraction. (v1
- v2
)
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to subtract from v1 . [(x, y, z)] |
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.
curve | input curve |
numSamples | number of samples along the curve |
numPointPerSample | number of generated samples per curve sample along the normal |
sampleSpacing | distance between generated samples |
randNumPoint | add a random number of generated samples |
seed | random seed |
randomSpace | random space |
minDist | the minimum distance between generated samples |
upVector | up vector |
returnTangentDirections | returns tangent directions instead of normal directions |
sampleDirections | directions for the generated samples |
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.
NumPoints | max number of samples |
radius | Disk radius |
shape | 0 circle, 1 square, 2 image |
MinDist | Minimum distance between samples |
seed | Random seed |
pixels | Pixels of the black/white image used to reject points |
numChannels | Image number of channels |
imageWidth | image width |
imageHeight | image height |
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.
NumPoints | max number of samples |
radius | Disk radius |
shape | 0 circle, 1 square, 2 image |
MinDist | Minimum distance between samples |
seed | Random seed |
pixels | Pixels of the black/white image used to reject points |
numChannels | Image number of channels |
imageWidth | image width |
imageHeight | image height |
|
inline |
Returns the absolute value.
[in] | a | The value. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | hf | An initialized heightfield. |
[in] | x | The width index where the span is to be added. [Limits: 0 <= value < rcHeightfield::width] |
[in] | y | The height index where the span is to be added. [Limits: 0 <= value < rcHeightfield::height] |
[in] | smin | The minimum height of the span. [Limit: < smax ] [Units: vx] |
[in] | smax | The maximum height of the span. [Limit: <= #RC_SPAN_MAX_HEIGHT] [Units: vx] |
[in] | area | The area id of the span. [Limit: <= #RC_WALKABLE_AREA) |
[in] | flagMergeThr | The merge theshold. [Limit: >= 0] [Units: vx] |
void* AtomsUtils::rcAlloc | ( | int | size, |
rcAllocHint | hint | ||
) |
Allocates a memory block.
[in] | size | The size, in bytes of memory, to allocate. |
[in] | hint | A hint to the allocator on how long the memory is expected to be in use. |
ATOMSUTILS_EXPORT rcClusterSet* AtomsUtils::rcAllocClusterSet | ( | ) |
Allocates a cluster set object using the Recast allocator.
ATOMSUTILS_EXPORT rcCompactHeightfield* AtomsUtils::rcAllocCompactHeightfield | ( | ) |
Allocates a compact heightfield object using the Recast allocator.
ATOMSUTILS_EXPORT rcContourSet* AtomsUtils::rcAllocContourSet | ( | ) |
Allocates a contour set object using the Recast allocator.
ATOMSUTILS_EXPORT rcHeightfield* AtomsUtils::rcAllocHeightfield | ( | ) |
Allocates a heightfield object using the Recast allocator.
ATOMSUTILS_EXPORT rcHeightfieldLayerSet* AtomsUtils::rcAllocHeightfieldLayerSet | ( | ) |
Allocates a heightfield layer set using the Recast allocator.
ATOMSUTILS_EXPORT rcPolyMesh* AtomsUtils::rcAllocPolyMesh | ( | ) |
Allocates a polygon mesh object using the Recast allocator.
ATOMSUTILS_EXPORT rcPolyMeshDetail* AtomsUtils::rcAllocPolyMeshDetail | ( | ) |
Allocates a detail mesh object using the Recast allocator.
ATOMSUTILS_EXPORT void AtomsUtils::rcAllocSetCustom | ( | rcAllocFunc * | allocFunc, |
rcFreeFunc * | freeFunc | ||
) |
ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildClusters | ( | rcContext * | ctx, |
rcContourSet & | cset, | ||
rcClusterSet & | clusters | ||
) |
Builds a cluster set from contours
[in,out] | ctx | The build context to use during the operaiton |
[in] | cset | Countour set |
[out] | clusters | Resulting cluster set |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[in] | walkableClimb | Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx] |
[in] | hf | The heightfield to be compacted. |
[out] | chf | The resulting compact heightfield. (Must be pre-allocated.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | chf | A fully built compact heightfield. |
[in] | maxError | The maximum distance a simplfied contour's border edges should deviate the original raw contour. [Limit: >=0] [Units: wu] |
[in] | maxEdgeLen | The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx] |
[out] | cset | The resulting contour set. (Must be pre-allocated.) |
[in] | buildFlags | The build flags. (See: rcBuildContoursFlags) |
ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildDistanceField | ( | rcContext * | ctx, |
rcCompactHeightfield & | chf | ||
) |
Builds the distance field for the specified compact heightfield.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | chf | A fully built compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[out] | lset | The resulting layer set. (Must be pre-allocated.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | chf | A fully built compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[in] | chunkSize | Size of chunk of subregion [Units: vx] |
[out] | lset | The resulting layer set. (Must be pre-allocated.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | chf | A fully built compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[out] | lset | The resulting layer set. (Must be pre-allocated.) |
ATOMSUTILS_EXPORT bool AtomsUtils::rcBuildPolyMesh | ( | rcContext * | ctx, |
rcContourSet & | cset, | ||
const int | nvp, | ||
rcPolyMesh & | mesh | ||
) |
Builds a polygon mesh from the provided contours.
[in,out] | ctx | The build context to use during the operation. |
[in] | cset | A fully built contour set. |
[in] | nvp | The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. [Limit: >= 3] |
[out] | mesh | The resulting polygon mesh. (Must be re-allocated.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | mesh | A fully built polygon mesh. |
[in] | chf | The compact heightfield used to build the polygon mesh. |
[in] | sampleDist | Sets the distance to use when samping the heightfield. [Limit: >=0] [Units: wu] |
[in] | sampleMaxError | The maximum distance the detail mesh surface should deviate from heightfield data. [Limit: >=0] [Units: wu] |
[out] | dmesh | The resulting detail mesh. (Must be pre-allocated.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | minRegionArea | The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]. |
[in] | mergeRegionArea | Any regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx] |
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.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | minRegionArea | The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]. |
[in] | mergeRegionArea | Any regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx] |
[in] | chunkSize | Size of subregion [Units: vx] |
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.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
[in] | borderSize | The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx] |
[in] | minRegionArea | The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]. |
[in] | mergeRegionArea | Any regions with a span count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: vx] |
ATOMSUTILS_EXPORT void AtomsUtils::rcCalcBounds | ( | const float * | verts, |
int | nv, | ||
float * | bmin, | ||
float * | bmax | ||
) |
Calculates the bounding box of an array of vertices.
[in] | verts | An array of vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices in the verts array. |
[out] | bmin | The minimum bounds of the AABB. [(x, y, z)] [Units: wu] |
[out] | bmax | The maximum bounds of the AABB. [(x, y, z)] [Units: wu] |
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.
[in] | bmin | The minimum bounds of the AABB. [(x, y, z)] [Units: wu] |
[in] | bmax | The maximum bounds of the AABB. [(x, y, z)] [Units: wu] |
[in] | cs | The xz-plane cell size. [Limit: > 0] [Units: wu] |
[out] | w | The width along the x-axis. [Limit: >= 0] [Units: vx] |
[out] | h | The height along the z-axis. [Limit: >= 0] [Units: vx] |
|
inline |
Clamps the value to the specified range.
[in] | v | The value to clamp. |
[in] | mn | The minimum permitted return value. |
[in] | mx | The maximum permitted return value. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableSlopeAngle | The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees] |
[in] | verts | The vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices. |
[in] | tris | The triangle vertex indices. [(vertA, vertB, vertC) * nt ] |
[in] | nt | The number of triangles. |
[out] | areas | The triangle area ids. [Length: >= nt ] |
ATOMSUTILS_EXPORT bool AtomsUtils::rcCopyPolyMesh | ( | rcContext * | ctx, |
const rcPolyMesh & | src, | ||
rcPolyMesh & | dst | ||
) |
Copies the poly mesh data from src to dst.
[in,out] | ctx | The build context to use during the operation. |
[in] | src | The source mesh to copy from. |
[out] | dst | The resulting detail mesh. (Must be pre-allocated, must be empty mesh.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | hf | The allocated heightfield to initialize. |
[in] | width | The width of the field along the x-axis. [Limit: >= 0] [Units: vx] |
[in] | height | The height of the field along the z-axis. [Limit: >= 0] [Units: vx] |
[in] | bmin | The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu] |
[in] | bmax | The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu] |
[in] | cs | The xz-plane cell size to use for the field. [Limit: > 0] [Units: wu] |
[in] | ch | The y-axis cell size to use for field. [Limit: > 0] [Units: wu] |
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)
[in,out] | ctx | The build context to use during the operation. |
[in] | radius | The radius of erosion. [Limits: 0 < value < 255] [Units: vx] |
[in] | height | Height threshold [Units: vx] |
[in] | areaId | The area id to apply [Limit: <= @RC_WALKABLE_AREA] |
[in] | filterFlags | See: rcFilterLowAreaFlags |
[in,out] | chf | The populated compact heightfield to erode. |
ATOMSUTILS_EXPORT bool AtomsUtils::rcErodeWalkableArea | ( | rcContext * | ctx, |
int | radius, | ||
rcCompactHeightfield & | chf | ||
) |
Erodes the walkable area within the heightfield by the specified radius.
[in,out] | ctx | The build context to use during the operation. |
[in] | radius | The radius of erosion. [Limits: 0 < value < 255] [Units: vx] |
[in,out] | chf | The populated compact heightfield to erode. |
ATOMSUTILS_EXPORT void AtomsUtils::rcFilterLedgeSpans | ( | rcContext * | ctx, |
const int | walkableHeight, | ||
const int | walkableClimb, | ||
rcHeightfield & | solid | ||
) |
Marks spans that are ledges as not-walkable.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[in] | walkableClimb | Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx] |
[in,out] | solid | A fully built heightfield. (All spans have been added.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableClimb | Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx] |
[in,out] | solid | A fully built heightfield. (All spans have been added.) |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableHeight | Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx] |
[in,out] | solid | A fully built heightfield. (All spans have been added.) |
void AtomsUtils::rcFree | ( | void * | ptr | ) |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreeClusterSet | ( | rcClusterSet * | clset | ) |
Frees the specified cluster set using the Recast allocator.
[in] | clset | A cluster set allocated using rcAllocClusterSet |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreeCompactHeightfield | ( | rcCompactHeightfield * | chf | ) |
Frees the specified compact heightfield object using the Recast allocator.
[in] | chf | A compact heightfield allocated using rcAllocCompactHeightfield |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreeContourSet | ( | rcContourSet * | cset | ) |
Frees the specified contour set using the Recast allocator.
[in] | cset | A contour set allocated using rcAllocContourSet |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreeHeightField | ( | rcHeightfield * | hf | ) |
Frees the specified heightfield object using the Recast allocator.
[in] | hf | A heightfield allocated using rcAllocHeightfield |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreeHeightfieldLayerSet | ( | rcHeightfieldLayerSet * | lset | ) |
Frees the specified heightfield layer set using the Recast allocator.
[in] | lset | A heightfield layer set allocated using rcAllocHeightfieldLayerSet |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreePolyMesh | ( | rcPolyMesh * | pmesh | ) |
Frees the specified polygon mesh using the Recast allocator.
[in] | pmesh | A polygon mesh allocated using rcAllocPolyMesh |
ATOMSUTILS_EXPORT void AtomsUtils::rcFreePolyMeshDetail | ( | rcPolyMeshDetail * | dmesh | ) |
Frees the specified detail mesh using the Recast allocator.
[in] | dmesh | A detail mesh allocated using rcAllocPolyMeshDetail |
|
inline |
Gets neighbor connection data for the specified direction.
[in] | s | The span to check. |
[in] | dir | The direction to check. [Limits: 0 <= value < 4] |
|
inline |
Gets the standard width (x-axis) offset for the specified direction.
[in] | dir | The direction. [Limits: 0 <= value < 4] |
|
inline |
Gets the standard height (z-axis) offset for the specified direction.
[in] | dir | The direction. [Limits: 0 <= value < 4] |
ATOMSUTILS_EXPORT int AtomsUtils::rcGetHeightFieldSpanCount | ( | rcContext * | ctx, |
rcHeightfield & | hf | ||
) |
Returns the number of spans contained in the specified heightfield.
[in,out] | ctx | The build context to use during the operation. |
[in] | hf | An initialized heightfield. |
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)
[in,out] | ctx | The build context to use during the operation. |
[in] | bmin | The minimum of the bounding box. [(x, y, z)] |
[in] | bmax | The maximum of the bounding box. [(x, y, z)] |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | verts | The vertices of the polygon [Fomr: (x, y, z) * nverts ] |
[in] | nverts | The number of vertices in the polygon. |
[in] | hmin | The height of the base of the polygon. |
[in] | hmax | The height of the top of the polygon. |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | pos | The center of the base of the cylinder. [Form: (x, y, z)] |
[in] | r | The radius of the cylinder. |
[in] | h | The height of the cylinder. |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
ATOMSUTILS_EXPORT bool AtomsUtils::rcMarkLowAreas | ( | rcContext * | ctx, |
unsigned int | height, | ||
unsigned char | areaId, | ||
rcCompactHeightfield & | chf | ||
) |
Marks all spans that have insufficient free space above
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
[in] | height | Height threshold [Units: vx] |
[in] | areaId | The area id to apply [Limit: <= @RC_WALKABLE_AREA] |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableSlopeAngle | The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees] |
[in] | verts | The vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices. |
[in] | tris | The triangle vertex indices. [(vertA, vertB, vertC) * nt ] |
[in] | nt | The number of triangles. |
[out] | areas | The triangle area ids. [Length: >= nt ] |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | walkableSlopeCos | The cosine of maximum slope that is considered walkable. [Limits: 0 <= value < 1] |
[in] | verts | The vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices. |
[in] | tris | The triangle vertex indices. [(vertA, vertB, vertC) * nt ] |
[in] | nt | The number of triangles. |
[out] | areas | The triangle area ids. [Length: >= nt ] |
|
inline |
Returns the maximum of two values.
[in] | a | Value A |
[in] | b | Value B |
ATOMSUTILS_EXPORT bool AtomsUtils::rcMedianFilterWalkableArea | ( | rcContext * | ctx, |
rcCompactHeightfield & | chf | ||
) |
Applies a median filter to walkable area types (based on area id), removing noise.
[in,out] | ctx | The build context to use during the operation. |
[in,out] | chf | A populated compact heightfield. |
ATOMSUTILS_EXPORT bool AtomsUtils::rcMergePolyMeshDetails | ( | rcContext * | ctx, |
rcPolyMeshDetail ** | meshes, | ||
const int | nmeshes, | ||
rcPolyMeshDetail & | mesh | ||
) |
Merges multiple detail meshes into a single detail mesh.
[in,out] | ctx | The build context to use during the operation. |
[in] | meshes | An array of detail meshes to merge. [Size: nmeshes ] |
[in] | nmeshes | The number of detail meshes in the meshes array. |
[out] | mesh | The resulting detail mesh. (Must be pre-allocated.) |
ATOMSUTILS_EXPORT bool AtomsUtils::rcMergePolyMeshes | ( | rcContext * | ctx, |
rcPolyMesh ** | meshes, | ||
const int | nmeshes, | ||
rcPolyMesh & | mesh | ||
) |
Merges multiple polygon meshes into a single mesh.
[in,out] | ctx | The build context to use during the operation. |
[in] | meshes | An array of polygon meshes to merge. [Size: nmeshes ] |
[in] | nmeshes | The number of polygon meshes in the meshes array. |
[in] | mesh | The resulting polygon mesh. (Must be pre-allocated.) |
|
inline |
Returns the minimum of two values.
[in] | a | Value A |
[in] | b | Value B |
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.
[in] | verts | The vertices of the polygon [Form: (x, y, z) * nverts ] |
[in] | nverts | The number of vertices in the polygon. |
[out] | outVerts | The offset vertices (should hold up to 2 * nverts ) [Form: (x, y, z) * return value] |
[in] | maxOutVerts | The max number of vertices that can be stored to outVerts . |
outVerts
. 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.
[in,out] | ctx | The build context to use during the operation. |
[in] | v0 | Triangle vertex 0 [(x, y, z)] |
[in] | v1 | Triangle vertex 1 [(x, y, z)] |
[in] | v2 | Triangle vertex 2 [(x, y, z)] |
[in] | area | The area id of the triangle. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | solid | An initialized heightfield. |
[in] | flagMergeThr | The distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx] |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | verts | The vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices. |
[in] | tris | The triangle indices. [(vertA, vertB, vertC) * nt ] |
[in] | areas | The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt ] |
[in] | nt | The number of triangles. |
[in,out] | solid | An initialized heightfield. |
[in] | flagMergeThr | The distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx] |
[in] | int | Flags to change the rasterization behavior |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | verts | The vertices. [(x, y, z) * nv ] |
[in] | nv | The number of vertices. |
[in] | tris | The triangle indices. [(vertA, vertB, vertC) * nt ] |
[in] | areas | The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt ] |
[in] | nt | The number of triangles. |
[in,out] | solid | An initialized heightfield. |
[in] | flagMergeThr | The distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx] |
[in] | int | Flags to change the rasterization behavior |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | verts | The triangle vertices. [(ax, ay, az, bx, by, bz, cx, by, cx) * nt ] |
[in] | areas | The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: nt ] |
[in] | nt | The number of triangles. |
[in,out] | solid | An initialized heightfield. |
[in] | flagMergeThr | The distance where the walkable flag is favored over the non-walkable flag. [Limit: >= 0] [Units: vx] |
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)
[in,out] | ctx | The build context to use during the operation. |
[in] | bmin | The minimum of the bounding box. [(x, y, z)] |
[in] | bmax | The maximum of the bounding box. [(x, y, z)] |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | verts | The vertices of the polygon [Fomr: (x, y, z) * nverts ] |
[in] | nverts | The number of vertices in the polygon. |
[in] | hmin | The height of the base of the polygon. |
[in] | hmax | The height of the top of the polygon. |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
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.
[in,out] | ctx | The build context to use during the operation. |
[in] | pos | The center of the base of the cylinder. [Form: (x, y, z)] |
[in] | r | The radius of the cylinder. |
[in] | h | The height of the cylinder. |
[in] | areaId | The area id to apply. [Limit: <= #RC_WALKABLE_AREA] |
[in,out] | chf | A populated compact heightfield. |
ATOMSUTILS_EXPORT void AtomsUtils::rcResetHeightfield | ( | rcHeightfield & | hf | ) |
Resets all spans of heightfield.
[in,out] | hf | The heightfield to reset. |
[in] | bmin | The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu] |
[in] | bmax | The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu] |
[in,out] | hf | The heightfield toreset. |
|
inline |
Sets the neighbor connection data for the specified direction.
[in] | s | The span to update. |
[in] | dir | The direction to set. [Limits: 0 <= value < 4] |
[in] | i | The index of the neighbor span. |
|
inline |
Returns the square of the value.
[in] | a | The value. |
float AtomsUtils::rcSqrt | ( | float | x | ) |
Returns the square root of the value.
[in] | x | The value. |
|
inline |
Swaps the values of the two parameters.
[in,out] | a | Value A |
[in,out] | b | Value B |
|
inline |
Performs a vector addition. (v1
+ v2
)
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to add to v1 . [(x, y, z)] |
|
inline |
Performs a vector copy.
[out] | dest | The result. [(x, y, z)] |
[in] | v | The vector to copy. [(x, y, z)] |
|
inline |
Derives the cross product of two vectors. (v1
x v2
)
[out] | dest | The cross product. [(x, y, z)] |
[in] | v1 | A Vector [(x, y, z)] |
[in] | v2 | A vector [(x, y, z)] |
|
inline |
Returns the distance between two points.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
|
inline |
Returns the square of the distance between two points.
[in] | v1 | A point. [(x, y, z)] |
[in] | v2 | A point. [(x, y, z)] |
|
inline |
Derives the dot product of two vectors. (v1
. v2
)
[in] | v1 | A Vector [(x, y, z)] |
[in] | v2 | A vector [(x, y, z)] |
|
inline |
Performs a scaled vector addition. (v1
+ (v2
* s
))
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to scale and add to v1 . [(x, y, z)] |
[in] | s | The amount to scale v2 by before adding to v1 . |
|
inline |
Selects the maximum value of each element from the specified vectors.
[in,out] | mx | A vector. (Will be updated with the result.) [(x, y, z)] |
[in] | v | A vector. [(x, y, z)] |
|
inline |
Selects the minimum value of each element from the specified vectors.
[in,out] | mn | A vector. (Will be updated with the result.) [(x, y, z)] |
[in] | v | A vector. [(x, y, z)] |
|
inline |
Normalizes the vector.
[in,out] | v | The vector to normalize. [(x, y, z)] |
|
inline |
Performs a vector subtraction. (v1
- v2
)
[out] | dest | The result vector. [(x, y, z)] |
[in] | v1 | The base vector. [(x, y, z)] |
[in] | v2 | The vector to subtract from v1 . [(x, y, z)] |
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.
dir | Ray direction |
orig | Ray origin |
center | Sphere center |
radius | Sphere radius |
t0 | First intersection (parametric coordinate) |
t1 | Second intersection (parametric coordinate) |