Box3D 0.1.0
A 3D physics engine for games
Loading...
Searching...
No Matches

Base functionality. More...

Data Structures

struct  b3Version
 Version numbering scheme. More...

Macros

#define B3_NULL_INDEX   -1
 This is used to indicate null for interfaces that work with indices instead of pointers.
#define B3_BREAKPOINT   assert( 0 )
 see https://github.com/scottt/debugbreak
#define B3_ASSERT(condition)
 Assert that a condition is true.
#define B3_VALIDATE(...)
 Validation is typically only enabled in debug builds.

Typedefs

typedef void * b3AllocFcn(int32_t size, int32_t alignment)
 Prototype for user allocation function.
typedef void b3FreeFcn(void *mem)
 Prototype for user free function.
typedef int b3AssertFcn(const char *condition, const char *fileName, int lineNumber)
 Prototype for the user assert callback. Return 0 to skip the debugger break.
typedef void b3LogFcn(const char *message)
 Prototype for user log callback. Used to log warnings.

Functions

void b3SetAllocator (b3AllocFcn *allocFcn, b3FreeFcn *freeFcn)
 This allows the user to override the allocation functions.
int32_t b3GetByteCount (void)
 Total bytes allocated by Box3D.
void b3SetAssertFcn (b3AssertFcn *assertFcn)
 Override the default assert callback.
int b3InternalAssert (const char *condition, const char *fileName, int lineNumber)
 Internal assertion handler. Allows for host intervention.
void b3SetLogFcn (b3LogFcn *logFcn)
 Override the default logging callback.
b3Version b3GetVersion (void)
 Get the current version of Box3D.
bool b3IsDoublePrecision (void)

Detailed Description

Base functionality.


Data Structure Documentation

◆ b3Version

struct b3Version

Version numbering scheme.

See https://semver.org/

Data Fields
int major Significant changes.
int minor Incremental changes.
int revision Bug fixes.

Macro Definition Documentation

◆ B3_ASSERT

#define B3_ASSERT ( condition)
Value:
( (void)( ( !!( condition ) ) || ( b3InternalAssert( #condition, __FILE__, (int)( __LINE__ ) ), 0 ) ) )
int b3InternalAssert(const char *condition, const char *fileName, int lineNumber)
Internal assertion handler. Allows for host intervention.

Assert that a condition is true.

◆ B3_BREAKPOINT

#define B3_BREAKPOINT   assert( 0 )

◆ B3_VALIDATE

#define B3_VALIDATE ( ...)
Value:
( (void)0 )

Validation is typically only enabled in debug builds.

Floating point tolerance checks should use this instead of the regular assertion

Typedef Documentation

◆ b3AllocFcn

typedef void * b3AllocFcn(int32_t size, int32_t alignment)

Prototype for user allocation function.

Parameters
sizethe allocation size in bytes
alignmentthe required alignment, guaranteed to be a power of 2

◆ b3FreeFcn

typedef void b3FreeFcn(void *mem)

Prototype for user free function.

Parameters
memthe memory previously allocated through b3AllocFcn

Function Documentation

◆ b3IsDoublePrecision()

bool b3IsDoublePrecision ( void )
Returns
true if the library was built with BOX3D_DOUBLE_PRECISION (large world mode)

◆ b3SetAllocator()

void b3SetAllocator ( b3AllocFcn * allocFcn,
b3FreeFcn * freeFcn )

This allows the user to override the allocation functions.

These should be set during application startup.

◆ b3SetAssertFcn()

void b3SetAssertFcn ( b3AssertFcn * assertFcn)

Override the default assert callback.

Parameters
assertFcna non-null assert callback