13#define IM3D_ASSERT(e) n_assert(e)
16#define IM3D_MALLOC(size) Memory::Alloc(Memory::DefaultHeap, size)
17#define IM3D_FREE(ptr) Memory::Free(Memory::DefaultHeap, ptr)
28#define IM3D_VERTEX_ALIGNMENT 4
37#define IM3D_VEC2_APP \
38 Vec2(const Math::vec2& _v) { x = _v.x; y = _v.y; } \
39 operator Math::vec2() const { return Math::vec2(x, y); }
40#define IM3D_VEC3_APP \
41 Vec3(const Math::point& _v) { x = _v.x; y = _v.y; z = _v.z; } \
42 operator Math::point() const { return Math::point(x, y, z); } \
43 Vec3(const Math::vector& _v) { x = _v.x; y = _v.y; z = _v.z; } \
44 operator Math::vector() const { return Math::vector(x, y, z); } \
45 Vec3(const Math::vec3& _v) { x = _v.x; y = _v.y; z = _v.z; } \
46 operator Math::vec3() const { return Math::vec3(x, y, z); }
47#define IM3D_VEC4_APP \
48 Vec4(const Math::point& _v) { x = _v.x; y = _v.y; z = _v.z; w = 1.0f; } \
49 operator Math::point() const { return Math::point(x, y, z); } \
50 Vec4(const Math::vec4& _v) { x = _v.x; y = _v.y; z = _v.z; w = _v.w; } \
51 operator Math::vec4() const { return Math::vec4(x, y, z, w); }
52#define IM3D_MAT3_APP \
53 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]; } \
54 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; }
55#define IM3D_MAT4_APP \
56 Mat4(const Math::mat4& _m) { _m.storeu(m);} \
57 operator Math::mat4() const { Math::mat4 ret; ret.loadu(m); return ret; }
Nebula compiler specific defines and configuration.
Implements a memory related functions.