Nebula
Loading...
Searching...
No Matches
im3d.cpp File Reference
#include "im3d.h"
#include "im3d_math.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cfloat>

Macros

#define va_copy(_dst, _src)
#define IM3D_CULL_PRIMITIVES   0
#define IM3D_CULL_GIZMOS   0
#define if_likely(e)
#define if_unlikely(e)
#define IM3D_RELATIVE_SNAP   0
#define IM3D_GIZMO_DEBUG   0
#define modinc(v)
#define IM3D_STATIC_ASSERT(e)

Functions

static U32 Hash (const char *_buf, int _buflen, U32 _base)
static U32 HashStr (const char *_str, U32 _base)
static float Snap (float _val, float _snap)
static Vec3 Snap (const Vec3 &_val, float _snap)
static Vec3 Snap (const Vec3 &_pos, const Plane &_plane, float _snap)
static void * AlignedMalloc (size_t _size, size_t _align)
static void AlignedFree (void *_ptr_)
static float Determinant (const Mat4 &_m)
static void StaticAsserts ()

Variables

constexpr Color Color_GizmoHighlight = Im3d::Color_Gold
static const int VertsPerDrawPrimitive [DrawPrimitive_Count]
static constexpr U32 kFnv1aPrime32 = 0x01000193u
static Context g_DefaultContext

Macro Definition Documentation

◆ if_likely

#define if_likely ( e)
Value:
if(!!(e))

◆ if_unlikely

#define if_unlikely ( e)
Value:
if(!!(e))

◆ IM3D_CULL_GIZMOS

#define IM3D_CULL_GIZMOS   0

◆ IM3D_CULL_PRIMITIVES

#define IM3D_CULL_PRIMITIVES   0

◆ IM3D_GIZMO_DEBUG

#define IM3D_GIZMO_DEBUG   0

◆ IM3D_RELATIVE_SNAP

#define IM3D_RELATIVE_SNAP   0

◆ IM3D_STATIC_ASSERT

#define IM3D_STATIC_ASSERT ( e)
Value:
{ (void)sizeof(char[(e) ? 1 : -1]); }

◆ modinc

#define modinc ( v)
Value:
@ DrawPrimitive_Count
Definition im3d.h:456

◆ va_copy

#define va_copy ( _dst,
_src )
Value:
(_dst = _src)

Function Documentation

◆ AlignedFree()

void AlignedFree ( void * _ptr_)
static

◆ AlignedMalloc()

void * AlignedMalloc ( size_t _size,
size_t _align )
static

◆ Determinant()

float Determinant ( const Mat4 & _m)
inlinestatic

◆ Hash()

U32 Hash ( const char * _buf,
int _buflen,
U32 _base )
static

◆ HashStr()

U32 HashStr ( const char * _str,
U32 _base )
static

◆ Snap() [1/3]

Vec3 Snap ( const Vec3 & _pos,
const Plane & _plane,
float _snap )
inlinestatic

◆ Snap() [2/3]

Vec3 Snap ( const Vec3 & _val,
float _snap )
inlinestatic

◆ Snap() [3/3]

float Snap ( float _val,
float _snap )
inlinestatic

◆ StaticAsserts()

void StaticAsserts ( )
static

Variable Documentation

◆ Color_GizmoHighlight

Color Color_GizmoHighlight = Im3d::Color_Gold
constexpr

◆ g_DefaultContext

Context g_DefaultContext
static

◆ kFnv1aPrime32

U32 kFnv1aPrime32 = 0x01000193u
staticconstexpr

◆ VertsPerDrawPrimitive

const int VertsPerDrawPrimitive[DrawPrimitive_Count]
static
Initial value:
=
{
3,
2,
1
}