浏览代码

math: make swizzling parameters readable in base 10 so that we understand

what's going on in the debugger.
undefined
Sam Hocevar 11 年前
父节点
当前提交
29dd656a78
共有 3 个文件被更改,包括 497 次插入491 次删除
  1. +1
    -2
      src/lol/base/types.h
  2. +491
    -489
      src/lol/math/vector.h
  3. +5
    -0
      test/unit/vector.cpp

+ 1
- 2
src/lol/base/types.h 查看文件

@@ -31,8 +31,7 @@ class half;
* Forward declaration of vec_t, mat_t, cmplx_t, quat_t * Forward declaration of vec_t, mat_t, cmplx_t, quat_t
*/ */


int const FULL_SWIZZLE = 0xaaaa;
int const NO_SWIZZLE = 0xbbbb;
int const FULL_SWIZZLE = 0;


template<typename T, int N, int SWIZZLE = FULL_SWIZZLE> struct vec_t; template<typename T, int N, int SWIZZLE = FULL_SWIZZLE> struct vec_t;
template<typename T, int COLS, int ROWS> struct mat_t; template<typename T, int COLS, int ROWS> struct mat_t;


+ 491
- 489
src/lol/math/vector.h
文件差异内容过多而无法显示
查看文件


+ 5
- 0
test/unit/vector.cpp 查看文件

@@ -138,6 +138,11 @@ LOLUNIT_FIXTURE(VectorTest)
LOLUNIT_ASSERT_EQUAL(c.y, 2.0f); LOLUNIT_ASSERT_EQUAL(c.y, 2.0f);
LOLUNIT_ASSERT_EQUAL(c.z, 3.0f); LOLUNIT_ASSERT_EQUAL(c.z, 3.0f);


c = a.zyx;
LOLUNIT_ASSERT_EQUAL(c.x, 3.0f);
LOLUNIT_ASSERT_EQUAL(c.y, 2.0f);
LOLUNIT_ASSERT_EQUAL(c.z, 1.0f);

#if 0 /* Visual Studio doesn't support these yet. */ #if 0 /* Visual Studio doesn't support these yet. */
c = a; c = a;
c.xy = b.yz; c.xy = b.yz;


正在加载...
取消
保存