diff --git a/demos/tutorial/12_voronoi.cpp b/demos/tutorial/12_voronoi.cpp index 7f3a39ce..768e28ae 100644 --- a/demos/tutorial/12_voronoi.cpp +++ b/demos/tutorial/12_voronoi.cpp @@ -187,7 +187,7 @@ public: while (i-- > 0) voronoi_points.Push(vec3(rand(512.f), rand(512.f), .0f), vec2(64.f + rand(64.f), 64.f + rand(64.f)) - //vec2(0.f) + //vec2::zero ); mode = 1; } @@ -316,7 +316,7 @@ public: Framebuffer *src_buf; Shader *shader; - if (curres == ivec2(0)) + if (curres == ivec2::zero) shader = m_screen_shader; else shader = m_fbos[m_cur_fbo].m2; @@ -352,7 +352,7 @@ public: #endif int i = 0; - if (curres == ivec2(0)) + if (curres == ivec2::zero) m_screen_shader->SetUniform(m_screen_texture, src_buf->GetTexture(), 0); else if (m_cur_fbo == VoronoiFbo) { @@ -368,12 +368,12 @@ public: m_fbos[m_cur_fbo].m2->Unbind(); dst_buf->Unbind(); - if (curres == ivec2(0)) + if (curres == ivec2::zero) break; if (curres == ivec2(1)) { if (buf == 1) - curres = ivec2(0); + curres = ivec2::zero; else break; } diff --git a/src/Makefile.am b/src/Makefile.am index fd3e866d..2b17b630 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,7 +76,7 @@ liblolcore_sources = \ base/assert.cpp base/hash.cpp base/log.cpp base/string.cpp \ \ math/vector.cpp math/real.cpp math/half.cpp math/trig.cpp \ - math/geometry.cpp \ + math/constants.cpp math/geometry.cpp \ \ gpu/shader.cpp gpu/indexbuffer.cpp gpu/vertexbuffer.cpp \ gpu/framebuffer.cpp gpu/texture.cpp gpu/renderer.cpp \ diff --git a/src/camera.cpp b/src/camera.cpp index b6d14c1d..b7eb7c3c 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -46,7 +46,7 @@ Camera::Camera() /* Create a default perspective */ SetProjection(m_fov, m_near, m_far, m_screen_size, m_screen_ratio); - SetView(mat4::lookat(vec3(0.f, 50.f, 50.f), vec3(0.f), vec3(0.f, 1.f, 0.f))); + SetView(mat4::lookat(vec3(0.f, 50.f, 50.f), vec3::zero, vec3::axis_y)); } Camera::~Camera() diff --git a/src/core.h b/src/core.h index 81543d52..91e7bc44 100644 --- a/src/core.h +++ b/src/core.h @@ -55,16 +55,8 @@ #if LOL_FEATURE_CXX11_CONSTEXPR # define LOL_CONSTEXPR constexpr -# define LOL_CONSTEXPR_DECLARATION(type, name, value) \ - static type constexpr name = value; -# define LOL_CONSTEXPR_DEFINITION(type, name, value) \ - /* Nothing */ #else # define LOL_CONSTEXPR /* Nothing */ -# define LOL_CONSTEXPR_DECLARATION(type, name, value) \ - static type const name; -# define LOL_CONSTEXPR_DEFINITION(type, name, value) \ - type const name = value; #endif diff --git a/src/debug/record.cpp b/src/debug/record.cpp index 6a965f66..99a0e27f 100644 --- a/src/debug/record.cpp +++ b/src/debug/record.cpp @@ -53,7 +53,7 @@ DebugRecord::DebugRecord(char const *path, float fps) Ticker::StartRecording(); data->path = strdup(path); - data->size = ivec2(0); + data->size = ivec2::zero; data->fps = (int)(fps + 0.5f); #if defined USE_PIPI data->sequence = nullptr; diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index deeddc6d..4ac61aca 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -146,7 +146,7 @@ void DefaultShaderData::SetupShaderDatas(mat4 const &model) for (int i = 0; i < lights.Count(); ++i) light_data << lights[i]->GetPosition() << lights[i]->GetColor(); while (light_data.Count() < 8) - light_data << vec4(0.f) << vec4(0.f); + light_data << vec4::zero << vec4::zero; m_shader->SetUniform(*GetUniform("u_Lights"), light_data); m_shader->SetUniform(*GetUniform("in_ModelView"), modelview); diff --git a/src/font.cpp b/src/font.cpp index e5178b2e..a30c9c0b 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -45,7 +45,7 @@ Font::Font(char const *path) { data->m_name = String(" ") + path; - data->tileset = Tiler::Register(path, ivec2(0), ivec2(16)); + data->tileset = Tiler::Register(path, ivec2::zero, ivec2(16)); data->size = data->tileset->GetTileSize(0); m_drawgroup = DRAWGROUP_BEFORE; diff --git a/src/gpu/framebuffer.cpp b/src/gpu/framebuffer.cpp index e66a9d95..8ce9ad71 100644 --- a/src/gpu/framebuffer.cpp +++ b/src/gpu/framebuffer.cpp @@ -471,7 +471,7 @@ void Framebuffer::Bind() * instead, maybe by getting rid of Framebuffer::Bind() and * creating RenderContext::SetFramebuffer() instead. */ m_data->m_saved_viewport = g_renderer->GetViewport(); - g_renderer->SetViewport(ibox2(ivec2(0), m_data->m_size)); + g_renderer->SetViewport(ibox2(ivec2::zero, m_data->m_size)); m_data->m_bound = true; } diff --git a/src/gpu/renderer.cpp b/src/gpu/renderer.cpp index a1cc7ec1..da2a85e7 100644 --- a/src/gpu/renderer.cpp +++ b/src/gpu/renderer.cpp @@ -138,7 +138,7 @@ Renderer::Renderer(ivec2 size) /* Initialise rendering states */ m_data->m_viewport = ibox2(0, 0, 0, 0); - SetViewport(ibox2(vec2(0), size)); + SetViewport(ibox2(vec2::zero, size)); m_data->m_clear_color = vec4(-1.f); SetClearColor(vec4(0.1f, 0.2f, 0.3f, 1.0f)); diff --git a/src/image/color/cie1931.cpp b/src/image/color/cie1931.cpp index bc0660b3..93ed4e63 100644 --- a/src/image/color/cie1931.cpp +++ b/src/image/color/cie1931.cpp @@ -582,7 +582,7 @@ vec3 Color::WavelengthToCIExyY(float nm) int i = (int)nm; if (i < 0 || i > 830 - 360) - return vec3(0.0f); + return vec3::zero; float t = nm - i, s = 1.0 - t; float x = s * cie_1931_xyz[i * 3 + 0] + t * cie_1931_xyz[i * 3 + 3]; diff --git a/src/input/input.cpp b/src/input/input.cpp index a06a4264..d492882c 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -47,7 +47,7 @@ void InputDeviceInternal::AddAxis(const char* name, float sensitivity) void InputDeviceInternal::AddCursor(const char* name) { m_cursornames.Push(name); - m_cursors.Push(vec2(0.0), ivec2(0)); + m_cursors.Push(vec2::zero, ivec2::zero); } InputDeviceInternal* InputDeviceInternal::CreateStandardKeyboard() diff --git a/src/light.cpp b/src/light.cpp index fccf94f1..732f46ca 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -27,7 +27,7 @@ Light::Light() m_gamegroup = GAMEGROUP_BEFORE; m_drawgroup = DRAWGROUP_CAMERA; - SetPosition(vec4(0.f)); + SetPosition(vec4::zero); } Light::~Light() diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index f09236e1..a7c68b6f 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -168,8 +168,8 @@ template struct XVec4 template struct BVec2 { - explicit inline BVec2() {} - explicit inline BVec2(T X, T Y) : x(X), y(Y) {} + explicit inline LOL_CONSTEXPR BVec2() {} + explicit inline LOL_CONSTEXPR BVec2(T X, T Y) : x(X), y(Y) {} union { @@ -236,21 +236,25 @@ template <> struct BVec2 template struct Vec2 : BVec2 { - inline Vec2() {} - inline Vec2(T X, T Y) : BVec2(X, Y) {} + inline LOL_CONSTEXPR Vec2() {} + inline LOL_CONSTEXPR Vec2(T X, T Y) : BVec2(X, Y) {} - explicit inline Vec2(T X) : BVec2(X, X) {} + explicit LOL_CONSTEXPR inline Vec2(T X) : BVec2(X, X) {} template - inline Vec2(XVec2 const &v) + inline LOL_CONSTEXPR Vec2(XVec2 const &v) : BVec2(v[0], v[1]) {} template - explicit inline Vec2(XVec2 const &v) + explicit inline LOL_CONSTEXPR Vec2(XVec2 const &v) : BVec2(v[0], v[1]) {} LOL_MEMBER_OPS(Vec2, x) + static const Vec2 zero; + static const Vec2 axis_x; + static const Vec2 axis_y; + template friend std::ostream &operator<<(std::ostream &stream, Vec2 const &v); }; @@ -261,9 +265,9 @@ template struct Vec2 : BVec2 template struct Cmplx { - inline Cmplx() {} - inline Cmplx(T X) : x(X), y(0) {} - inline Cmplx(T X, T Y) : x(X), y(Y) {} + inline LOL_CONSTEXPR Cmplx() {} + inline LOL_CONSTEXPR Cmplx(T X) : x(X), y(0) {} + inline LOL_CONSTEXPR Cmplx(T X, T Y) : x(X), y(Y) {} LOL_MEMBER_OPS(Cmplx, x) @@ -331,8 +335,8 @@ static inline bool operator !=(T a, Cmplx const &b) { return b != a; } template struct BVec3 { - explicit inline BVec3() {} - explicit inline BVec3(T X, T Y, T Z) : x(X), y(Y), z(Z) {} + explicit inline LOL_CONSTEXPR BVec3() {} + explicit inline LOL_CONSTEXPR BVec3(T X, T Y, T Z) : x(X), y(Y), z(Z) {} union { @@ -473,7 +477,8 @@ template struct BVec3 template <> struct BVec3 { explicit inline BVec3() {} - explicit inline BVec3(half X, half Y, half Z) : x(X), y(Y), z(Z) {} + explicit inline BVec3(half X, half Y, half Z) + : x(X), y(Y), z(Z) {} half x, y, z; }; @@ -488,19 +493,19 @@ template <> struct BVec3 template struct Vec3 : BVec3 { - inline Vec3() {} - inline Vec3(T X, T Y, T Z) : BVec3(X, Y, Z) {} - inline Vec3(Vec2 XY, T Z) : BVec3(XY.x, XY.y, Z) {} - inline Vec3(T X, Vec2 YZ) : BVec3(X, YZ.x, YZ.y) {} + inline LOL_CONSTEXPR Vec3() {} + inline LOL_CONSTEXPR Vec3(T X, T Y, T Z) : BVec3(X, Y, Z) {} + inline LOL_CONSTEXPR Vec3(Vec2 XY, T Z) : BVec3(XY.x, XY.y, Z) {} + inline LOL_CONSTEXPR Vec3(T X, Vec2 YZ) : BVec3(X, YZ.x, YZ.y) {} - explicit inline Vec3(T X) : BVec3(X, X, X) {} + explicit inline LOL_CONSTEXPR Vec3(T X) : BVec3(X, X, X) {} template - inline Vec3(XVec3 const &v) + inline LOL_CONSTEXPR Vec3(XVec3 const &v) : BVec3(v[0], v[1], v[2]) {} template - explicit inline Vec3(XVec3 const &v) + explicit inline LOL_CONSTEXPR Vec3(XVec3 const &v) : BVec3(v[0], v[1], v[2]) {} static Vec3 toeuler_xyx(Quat const &q); @@ -519,6 +524,11 @@ template struct Vec3 : BVec3 LOL_MEMBER_OPS(Vec3, x) + static const Vec3 zero; + static const Vec3 axis_x; + static const Vec3 axis_y; + static const Vec3 axis_z; + template friend std::ostream &operator<<(std::ostream &stream, Vec3 const &v); }; @@ -529,8 +539,9 @@ template struct Vec3 : BVec3 template struct BVec4 { - explicit inline BVec4() {} - explicit inline BVec4(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) {} + explicit inline LOL_CONSTEXPR BVec4() {} + explicit inline LOL_CONSTEXPR BVec4(T X, T Y, T Z, T W) + : x(X), y(Y), z(Z), w(W) {} union { @@ -907,27 +918,40 @@ template <> struct BVec4 template struct Vec4 : BVec4 { - inline Vec4() {} - inline Vec4(T X, T Y, T Z, T W) : BVec4(X, Y, Z, W) {} - inline Vec4(Vec2 XY, T Z, T W) : BVec4(XY.x, XY.y, Z, W) {} - inline Vec4(T X, Vec2 YZ, T W) : BVec4(X, YZ.x, YZ.y, W) {} - inline Vec4(T X, T Y, Vec2 ZW) : BVec4(X, Y, ZW.x, ZW.y) {} - inline Vec4(Vec2 XY, Vec2 ZW) : BVec4(XY.x, XY.y, ZW.x, ZW.y) {} - inline Vec4(Vec3 XYZ, T W) : BVec4(XYZ.x, XYZ.y, XYZ.z, W) {} - inline Vec4(T X, Vec3 YZW) : BVec4(X, YZW.x, YZW.y, YZW.z) {} - - explicit inline Vec4(T X) : BVec4(X, X, X, X) {} + inline LOL_CONSTEXPR Vec4() {} + inline LOL_CONSTEXPR Vec4(T X, T Y, T Z, T W) + : BVec4(X, Y, Z, W) {} + inline LOL_CONSTEXPR Vec4(Vec2 XY, T Z, T W) + : BVec4(XY.x, XY.y, Z, W) {} + inline LOL_CONSTEXPR Vec4(T X, Vec2 YZ, T W) + : BVec4(X, YZ.x, YZ.y, W) {} + inline LOL_CONSTEXPR Vec4(T X, T Y, Vec2 ZW) + : BVec4(X, Y, ZW.x, ZW.y) {} + inline LOL_CONSTEXPR Vec4(Vec2 XY, Vec2 ZW) + : BVec4(XY.x, XY.y, ZW.x, ZW.y) {} + inline LOL_CONSTEXPR Vec4(Vec3 XYZ, T W) + : BVec4(XYZ.x, XYZ.y, XYZ.z, W) {} + inline LOL_CONSTEXPR Vec4(T X, Vec3 YZW) + : BVec4(X, YZW.x, YZW.y, YZW.z) {} + + explicit inline LOL_CONSTEXPR Vec4(T X) : BVec4(X, X, X, X) {} template - inline Vec4(XVec4 const &v) + inline LOL_CONSTEXPR Vec4(XVec4 const &v) : BVec4(v[0], v[1], v[2], v[3]) {} template - explicit inline Vec4(XVec4 const &v) + explicit inline LOL_CONSTEXPR Vec4(XVec4 const &v) : BVec4(v[0], v[1], v[2], v[3]) {} LOL_MEMBER_OPS(Vec4, x) + static const Vec4 zero; + static const Vec4 axis_x; + static const Vec4 axis_y; + static const Vec4 axis_z; + static const Vec4 axis_w; + template friend std::ostream &operator<<(std::ostream &stream, Vec4 const &v); }; @@ -938,9 +962,9 @@ template struct Vec4 : BVec4 template struct Quat { - inline Quat() {} - inline Quat(T W) : w(W), x(0), y(0), z(0) {} - inline Quat(T W, T X, T Y, T Z) : w(W), x(X), y(Y), z(Z) {} + inline LOL_CONSTEXPR Quat() {} + inline LOL_CONSTEXPR Quat(T W) : w(W), x(0), y(0), z(0) {} + inline LOL_CONSTEXPR Quat(T W, T X, T Y, T Z) : w(W), x(X), y(Y), z(Z) {} Quat(Mat3 const &m); Quat(Mat4 const &m); diff --git a/src/lolcore.vcxproj b/src/lolcore.vcxproj index 7e3e1443..5f78bc01 100644 --- a/src/lolcore.vcxproj +++ b/src/lolcore.vcxproj @@ -149,6 +149,7 @@ + @@ -314,4 +315,4 @@ - \ No newline at end of file + diff --git a/src/map.cpp b/src/map.cpp index 370df916..2357b834 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -131,7 +131,7 @@ LevelMap::LevelMap(char const *path) { /* This is a tileset image file. Associate it with firstgid. */ data->tilesets[data->ntilers] = Tiler::Register(str, ivec2(32), - ivec2(0)); + ivec2::zero); data->ntilers++; //Log::Debug("new tiler %s\n", str); } diff --git a/src/math/constants.cpp b/src/math/constants.cpp new file mode 100644 index 00000000..cc146b58 --- /dev/null +++ b/src/math/constants.cpp @@ -0,0 +1,63 @@ +// +// Lol Engine +// +// Copyright: (c) 2010-2013 Sam Hocevar +// This program is free software; you can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To +// Public License, Version 2, as published by Sam Hocevar. See +// http://www.wtfpl.net/ for more details. +// + +#if defined HAVE_CONFIG_H +# include "config.h" +#endif + +#include "core.h" + +namespace lol { + +#define LOL_VEC_2_CONST(type, name, a, b) \ + template<> \ + Vec2 const Vec2::name = Vec2((type)a, (type)b); + +#define LOL_VEC_3_CONST(type, name, a, b, c) \ + template<> \ + Vec3 const Vec3::name = Vec3((type)a, (type)b, (type)c); + +#define LOL_VEC_4_CONST(type, name, a, b, c, d) \ + template<> \ + Vec4 const Vec4::name = Vec4((type)a, (type)b, (type)c, (type)d); + +#define LOL_ALL_VECTOR_CONST_INNER(type) \ + LOL_VEC_2_CONST(type, zero, 0, 0) \ + LOL_VEC_2_CONST(type, axis_x, 1, 0) \ + LOL_VEC_2_CONST(type, axis_y, 0, 1) \ + \ + LOL_VEC_3_CONST(type, zero, 0, 0, 0) \ + LOL_VEC_3_CONST(type, axis_x, 1, 0, 0) \ + LOL_VEC_3_CONST(type, axis_y, 0, 1, 0) \ + LOL_VEC_3_CONST(type, axis_z, 0, 0, 1) \ + \ + LOL_VEC_4_CONST(type, zero, 0, 0, 0, 0) \ + LOL_VEC_4_CONST(type, axis_x, 1, 0, 0, 0) \ + LOL_VEC_4_CONST(type, axis_y, 0, 1, 0, 0) \ + LOL_VEC_4_CONST(type, axis_z, 0, 0, 1, 0) \ + LOL_VEC_4_CONST(type, axis_w, 0, 0, 0, 1) + +LOL_ALL_VECTOR_CONST_INNER(half) +LOL_ALL_VECTOR_CONST_INNER(float) +LOL_ALL_VECTOR_CONST_INNER(double) +LOL_ALL_VECTOR_CONST_INNER(ldouble) +LOL_ALL_VECTOR_CONST_INNER(real) + +LOL_ALL_VECTOR_CONST_INNER(int8_t) +LOL_ALL_VECTOR_CONST_INNER(uint8_t) +LOL_ALL_VECTOR_CONST_INNER(int16_t) +LOL_ALL_VECTOR_CONST_INNER(uint16_t) +LOL_ALL_VECTOR_CONST_INNER(int32_t) +LOL_ALL_VECTOR_CONST_INNER(uint32_t) +LOL_ALL_VECTOR_CONST_INNER(int64_t) +LOL_ALL_VECTOR_CONST_INNER(uint64_t) + +}; /* namespace lol */ + diff --git a/src/math/vector.cpp b/src/math/vector.cpp index 3981ee8f..4634c8e1 100644 --- a/src/math/vector.cpp +++ b/src/math/vector.cpp @@ -535,7 +535,7 @@ static inline vec3 quat_toeuler_generic(quat const &q, int i, int j, int k) float n = norm(q); if (!n) - return vec3(0.f); + return vec3::zero; /* (2 + i - j) % 3 means x-y-z direct order; otherwise indirect */ float const sign = ((2 + i - j) % 3) ? 1.f : -1.f; diff --git a/src/platform/sdl/sdlinput.cpp b/src/platform/sdl/sdlinput.cpp index 63bdc881..c2009fc3 100644 --- a/src/platform/sdl/sdlinput.cpp +++ b/src/platform/sdl/sdlinput.cpp @@ -48,7 +48,7 @@ private: #if USE_SDL SdlInputData(int app_w, int app_h, int screen_w, int screen_h) : - m_prevmouse(ivec2(0)), + m_prevmouse(ivec2::zero), m_app_w((float)app_w), m_app_h((float)app_h), m_screen_w((float)screen_w), diff --git a/src/worldentity.cpp b/src/worldentity.cpp index b6401f95..3b2a6b64 100644 --- a/src/worldentity.cpp +++ b/src/worldentity.cpp @@ -25,11 +25,11 @@ namespace lol WorldEntity::WorldEntity() { - m_position = vec3(0); + m_position = vec3::zero; m_rotation = quat(1); - m_velocity = vec3(0); - m_rotation_velocity = vec3(0); - m_bbox[0] = m_bbox[1] = vec3(0); + m_velocity = vec3::zero; + m_rotation_velocity = vec3::zero; + m_bbox[0] = m_bbox[1] = vec3::zero; } WorldEntity::~WorldEntity() diff --git a/test/btphystest.cpp b/test/btphystest.cpp index fa5dd227..c6325006 100644 --- a/test/btphystest.cpp +++ b/test/btphystest.cpp @@ -66,7 +66,7 @@ void BtPhysTest::InitApp() #if CAT_MODE /* cat datas setup */ - m_cat_texture = Tiler::Register("data/CatsSheet.png", ivec2(0), ivec2(0,1)); + m_cat_texture = Tiler::Register("data/CatsSheet.png", ivec2::zero, ivec2(0,1)); m_fov_dp = .0f; m_loc_dp = .0f; #endif //CAT_MODE diff --git a/test/meshviewer.cpp b/test/meshviewer.cpp index 985f1da0..8dacaf75 100644 --- a/test/meshviewer.cpp +++ b/test/meshviewer.cpp @@ -136,12 +136,12 @@ public: m_zoom_mesh = 0.f; m_zoom_speed = 0.f; m_rot = vec2(45.f); - m_rot_mesh = vec2(0.f); - m_rot_speed = vec2(0.f); - m_pos = vec2(0.f); - m_pos_mesh = vec2(0.f); - m_pos_speed = vec2(0.f); - m_screen_offset = vec2(0.f); + m_rot_mesh = vec2::zero; + m_rot_speed = vec2::zero; + m_pos = vec2::zero; + m_pos_mesh = vec2::zero; + m_pos_speed = vec2::zero; + m_screen_offset = vec2::zero; m_camera = new Camera(); m_camera->SetView(vec3(0.f, 0.f, 10.f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f)); @@ -206,7 +206,7 @@ public: //Camera update bool is_pos = false; bool is_fov = false; - vec2 tmp = vec2(0.f); + vec2 tmp = vec2::zero; #if !__native_client__ is_pos = m_controller->GetKey(KEY_CAM_POS).IsDown(); @@ -252,7 +252,7 @@ public: #if !__native_client__ if (m_controller->GetKey(KEY_CAM_RESET).IsDown()) { - pos_mesh = vec2(0.f); + pos_mesh = vec2::zero; zoom_mesh = 0.f; } #endif //!__native_client__ @@ -426,7 +426,7 @@ public: { m_texture_shader = Shader::Create(LOLFX_RESOURCE_NAME(shinymvtexture)); m_texture_uni = m_texture_shader->GetUniformLocation("u_Texture"); - m_default_texture = Tiler::Register("data/test-texture.png", ivec2(0), ivec2(0,1)); + m_default_texture = Tiler::Register("data/test-texture.png", ivec2::zero, ivec2(0,1)); } else if (m_texture && m_default_texture) m_texture_shader->SetUniform(m_texture_uni, m_default_texture->GetTexture(), 0); diff --git a/test/unit/camera.cpp b/test/unit/camera.cpp index aba8ab9c..858a1e15 100644 --- a/test/unit/camera.cpp +++ b/test/unit/camera.cpp @@ -38,8 +38,8 @@ LOLUNIT_FIXTURE(CameraTest) void SetUp() { eye = vec3(0.f, 0.f, 50.f); - target = vec3(0.f); - up = vec3(0.f, 1.f, 0.f); + target = vec3::zero; + up = vec3::axis_y; m_lookat = mat4::lookat(eye, target, up); q_lookat = quat(m_lookat); v_lookat = vec3::toeuler_zyx(q_lookat);