Recast: move bit cell code to SharedCommon

This commit is contained in:
Kawe Mazidjatari 2024-07-16 11:49:41 +02:00
parent abc8b0db1e
commit 8c4bcc13d7
2 changed files with 8 additions and 7 deletions

View File

@ -20,7 +20,9 @@
#define RECASTDETOURCOMMON_H
#include "Shared/Include/SharedMath.h"
#include <stddef.h>
/// The total number of bits in an bit cell integer.
static const int RD_BITS_PER_BIT_CELL = 32;
/**
@defgroup shared Shared
@ -40,6 +42,11 @@ feature to find minor members.
/// @param [in] _ Unused parameter
template<class T> void rdIgnoreUnused(const T&) { }
/// Tests a specific bit in a bit cell
/// @param[in] i The bit number
/// @return The offset mask for the bit.
inline int rdBitCellBit(const int i) { return (1 << ((i) & (RD_BITS_PER_BIT_CELL-1))); }
/// Swaps the values of the two parameters.
/// @param[in,out] a Value A
/// @param[in,out] b Value B

View File

@ -12,12 +12,6 @@ Members in this module are wrappers around the standard math library
/// The value of PI used by Recast & Detour.
static const float RD_PI = 3.14159265f;
/// The total number of bits in an bit cell integer.
static const int RD_BITS_PER_BIT_CELL = 32;
// TODO: move to common!
inline int rdBitCellBit(const int bitNum) { return (1 << ((bitNum) & (RD_BITS_PER_BIT_CELL-1))); }
inline float rdMathFabsf(float x) { return fabsf(x); }
inline float rdMathSqrtf(float x) { return sqrtf(x); }
inline float rdMathFloorf(float x) { return floorf(x); }