Skip to content

Commit

Permalink
Ported FAQ to a markdown file in the docs folder
Browse files Browse the repository at this point in the history
So that it's shipped with the code and also part of the doxygen docs at recastnav.com
  • Loading branch information
grahamboree committed Jan 5, 2024
1 parent bc0d1b1 commit 1605a55
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# FAQ

## Which C++ version and features do Recast use?

All code in Recast and Detour strictly adheres to the following:

* C++98
* no STL
* no exceptions
* no RTTI
* minimal inheritance
* minimal templates

RecastDemo is a bit looser with these requirements, as it's only meant to showcase Recast usage and functionality, not be part of a shipped product.

## Why doesn't Recast use STL/Exceptions/RTTI/C++11/my favorite C++ feature?

Recast has always strived to maximize its ease of integration into an existing codebase, its portability to unique platforms, and its runtime performance. Recast was forged in the fires of game development, and as such follows the cultural norms of the games industry.

For example, some platforms have limited C++ compilers and STL implementations, so avoiding newer C++ features and the STL entirely helps tremendously when working in those environments. Additionally, exceptions and RTTI require a non-trivial runtime overhead to support. This is in conflict with Recast's goal of maximum performance.

## How do I use Recast to build a navmesh?

The process is thoroughly outlined and documented in the RecastDemo project. `Sample_SoloMesh.cpp` is a good introduction to the general process of building a navmesh. It builds a single, unified navmesh and is the simpler and more limited of the two examples. `Sample_TileMesh.cpp` builds a tiled navmesh that supports all of Recast and Detour's features around dynamic obstacles and runtime re-meshing.

## How do Recast and Detour handle memory allocations?

Recast and Detour strive to avoid heap allocations whenver possible. When heap allocations are necessary, they are routed through centralized allocation and de-allocation functions. These centralized functions allow you to optionally override them with custom allocator implementations, but just use `malloc` and `free` by default. Check out `RecastAlloc.h` and `DetourAlloc.h` for more.

## Does Recast do any logging?

Yes and no: recast provides a `log(...)` function through `rcContext`. There are currently 3 levels: progress, warning, and error. If logging is enabled, the context calls the doLog() virtual function which is empty by default.

## What are the dependencies for RecastDemo?

* SDL 2
* OpenGL
* GLU

0 comments on commit 1605a55

Please sign in to comment.