ソースを参照

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


読み込み中…
キャンセル
保存