Nebula
Loading...
Searching...
No Matches
im3d_config.h File Reference
#include "render/stdneb.h"
#include "core/config.h"
#include "memory/memory.h"
#include "math/vec4.h"
#include "math/vec2.h"
#include "math/mat4.h"

Go to the source code of this file.

Macros

#define im3d_config_h
 
#define IM3D_ASSERT(e)   n_assert(e)
 
#define IM3D_MALLOC(size)   Memory::Alloc(Memory::DefaultHeap, size)
 
#define IM3D_FREE(ptr)   Memory::Free(Memory::DefaultHeap, ptr)
 
#define IM3D_VERTEX_ALIGNMENT   4
 
#define IM3D_VEC2_APP
 
#define IM3D_VEC3_APP
 
#define IM3D_VEC4_APP
 
#define IM3D_MAT3_APP
 
#define IM3D_MAT4_APP
 

Macro Definition Documentation

◆ IM3D_ASSERT

#define IM3D_ASSERT ( e)    n_assert(e)

◆ im3d_config_h

#define im3d_config_h

◆ IM3D_FREE

#define IM3D_FREE ( ptr)    Memory::Free(Memory::DefaultHeap, ptr)

◆ IM3D_MALLOC

#define IM3D_MALLOC ( size)    Memory::Alloc(Memory::DefaultHeap, size)

◆ IM3D_MAT3_APP

#define IM3D_MAT3_APP
Value:
Mat3(const Math::mat4& _m) { float b[16]; _m.storeu(b); for(int j = 0 ; j < 3;++j) for (int i = 0; i < 3; ++i) m[i+j*3] = b[i + j*4]; } \
operator Math::mat4() const { Math::mat4 ret; float b[16]; ret.storeu(b); int k = 0; for(int j = 0 ; j < 3;++j) for (int i = 0; i < 3; ++i) b[i+4*j] = m[i+j*3]; ret.loadu(b); return ret; }
A 4x4 single point precision float matrix.
Definition mat4.h:47
void loadu(const scalar *ptr)
load content from unaligned memory
Definition mat4.h:213
void storeu(scalar *ptr) const
write content to unaligned memory through the write cache
Definition mat4.h:248

◆ IM3D_MAT4_APP

#define IM3D_MAT4_APP
Value:
Mat4(const Math::mat4& _m) { _m.storeu(m);} \
operator Math::mat4() const { Math::mat4 ret; ret.loadu(m); return ret; }

◆ IM3D_VEC2_APP

#define IM3D_VEC2_APP
Value:
Vec2(const Math::vec2& _v) { x = _v.x; y = _v.y; } \
operator Math::vec2() const { return Math::vec2(x, y); }
A 2-component float vector class.
Definition vec2.h:21
scalar x
Definition vec2.h:86
scalar y
Definition vec2.h:87

◆ IM3D_VEC3_APP

#define IM3D_VEC3_APP
Value:
Vec3(const Math::point& _v) { x = _v.x; y = _v.y; z = _v.z; } \
operator Math::point() const { return Math::point(x, y, z); } \
Vec3(const Math::vector& _v) { x = _v.x; y = _v.y; z = _v.z; } \
operator Math::vector() const { return Math::vector(x, y, z); } \
Vec3(const Math::vec3& _v) { x = _v.x; y = _v.y; z = _v.z; } \
operator Math::vec3() const { return Math::vec3(x, y, z); }
Represents a 3D point in space.
Definition point.h:22
float z
Definition point.h:78
float x
Definition point.h:78
float y
Definition point.h:78
A 3D vector.
Definition vec3.h:39
float x
Definition vec3.h:93
float z
Definition vec3.h:93
float y
Definition vec3.h:93
A vector is a 3D direction in space.
Definition vector.h:22
float z
Definition vector.h:85
float x
Definition vector.h:85
float y
Definition vector.h:85

◆ IM3D_VEC4_APP

#define IM3D_VEC4_APP
Value:
Vec4(const Math::point& _v) { x = _v.x; y = _v.y; z = _v.z; w = 1.0f; } \
operator Math::point() const { return Math::point(x, y, z); } \
Vec4(const Math::vec4& _v) { x = _v.x; y = _v.y; z = _v.z; w = _v.w; } \
operator Math::vec4() const { return Math::vec4(x, y, z, w); }
A 4D vector.
Definition vec4.h:24
float y
Definition vec4.h:93
float z
Definition vec4.h:93
float w
Definition vec4.h:93
float x
Definition vec4.h:93

◆ IM3D_VERTEX_ALIGNMENT

#define IM3D_VERTEX_ALIGNMENT   4