浏览代码

Implement vector square length.

legacy
Sam Hocevar sam 15 年前
父节点
当前提交
dc45c9e426
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      src/matrix.h

+ 7
- 2
src/matrix.h 查看文件

@@ -60,12 +60,17 @@
return ret; \
} \
\
inline float len() const \
inline T sqlen() const \
{ \
T acc = 0; \
for (int n = 0; n < elems; n++) \
acc += (*this)[n] * (*this)[n]; \
return sqrtf((float)acc); \
return acc; \
} \
\
inline float len() const \
{ \
return sqrtf((float)sqlen()); \
}

template <typename T> struct Vec2


正在加载...
取消
保存