#include <cmath>Include dependency graph for vecmath.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C + a[R].w * b[3].C) |
| #define | MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C) |
Typedefs | |
| typedef Matrix3< double > | Mat3d |
| typedef Matrix3< float > | Mat3f |
| typedef Matrix4< double > | Mat4d |
| typedef Matrix4< float > | Mat4f |
| typedef Point2< float > | Point2f |
| typedef Point3< double > | Point3d |
| typedef Point3< float > | Point3f |
| typedef Vector2< float > | Vec2f |
| typedef Vector3< double > | Vec3d |
| typedef Vector3< float > | Vec3f |
| typedef Vector4< double > | Vec4d |
| typedef Vector4< float > | Vec4f |
Functions | |
| template<class T> | |
| Vector3< T > | cross (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| T | det2x2 (T a, T b, T c, T d) |
| template<class T> | |
| T | dot (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| T | dot (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Matrix4< T > | operator * (const Matrix4< T > &a, const Matrix4< T > &b) |
| template<class T> | |
| Vector4< T > | operator * (const Vector4< T > &v, const Matrix4< T > &m) |
| template<class T> | |
| Vector4< T > | operator * (const Matrix4< T > &m, const Vector4< T > &v) |
| template<class T> | |
| Point3< T > | operator * (const Point3< T > &p, const Matrix4< T > &m) |
| template<class T> | |
| Point3< T > | operator * (const Matrix4< T > &m, const Point3< T > &p) |
| template<class T> | |
| Vector3< T > | operator * (const Vector3< T > &v, const Matrix4< T > &m) |
| template<class T> | |
| Vector3< T > | operator * (const Matrix4< T > &m, const Vector3< T > &v) |
| template<class T> | |
| Matrix3< T > | operator * (const Matrix3< T > &a, const Matrix3< T > &b) |
| template<class T> | |
| Point3< T > | operator * (const Point3< T > &p, const Matrix3< T > &m) |
| template<class T> | |
| Point3< T > | operator * (const Matrix3< T > &m, const Point3< T > &p) |
| template<class T> | |
| Vector3< T > | operator * (const Vector3< T > &v, const Matrix3< T > &m) |
| template<class T> | |
| Vector3< T > | operator * (const Matrix3< T > &m, const Vector3< T > &v) |
| template<class T> | |
| T | operator * (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| Vector4< T > | operator * (const Vector4< T > &v, T s) |
| template<class T> | |
| Vector4< T > | operator * (T s, const Vector4< T > &v) |
| template<class T> | |
| Point3< T > | operator * (T s, const Point3< T > &p) |
| template<class T> | |
| Point3< T > | operator * (const Point3< T > &p, T s) |
| template<class T> | |
| T | operator * (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Vector3< T > | operator * (const Vector3< T > &v, T s) |
| template<class T> | |
| Vector3< T > | operator * (T s, const Vector3< T > &v) |
| template<class T> | |
| bool | operator!= (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| bool | operator!= (const Point2< T > &a, const Point2< T > &b) |
| template<class T> | |
| bool | operator!= (const Vector2< T > &a, const Vector2< T > &b) |
| template<class T> | |
| bool | operator!= (const Point3< T > &a, const Point3< T > &b) |
| template<class T> | |
| bool | operator!= (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Matrix4< T > | operator+ (const Matrix4< T > &a, const Matrix4< T > &b) |
| template<class T> | |
| Matrix3< T > | operator+ (const Matrix3< T > &a, const Matrix3< T > &b) |
| template<class T> | |
| Vector4< T > | operator+ (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| Point3< T > | operator+ (const Point3< T > &p, const Vector3< T > &v) |
| template<class T> | |
| Vector3< T > | operator+ (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Vector4< T > | operator- (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| Point3< T > | operator- (const Point3< T > &p, const Vector3< T > &v) |
| template<class T> | |
| Vector3< T > | operator- (const Point3< T > &a, const Point3< T > &b) |
| template<class T> | |
| Vector3< T > | operator- (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Vector3< T > | operator/ (const Vector3< T > &v, T s) |
| template<class T> | |
| bool | operator== (const Vector4< T > &a, const Vector4< T > &b) |
| template<class T> | |
| bool | operator== (const Point2< T > &a, const Point2< T > &b) |
| template<class T> | |
| bool | operator== (const Vector2< T > &a, const Vector2< T > &b) |
| template<class T> | |
| bool | operator== (const Point3< T > &a, const Point3< T > &b) |
| template<class T> | |
| bool | operator== (const Vector3< T > &a, const Vector3< T > &b) |
| template<class T> | |
| Vector3< T > | operator^ (const Vector3< T > &a, const Vector3< T > &b) |
|
|
|
|
|
Referenced by operator *(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
Definition at line 293 of file vecmath.h. Referenced by Convert3DSMesh(), ConvertToVertexList(), convertToVertexList(), generateNormals(), SphereMesh::generateNormals(), and Plane< T >::intersection(). 00294 {
00295 return Vector3<T>(a.y * b.z - a.z * b.y,
00296 a.z * b.x - a.x * b.z,
00297 a.x * b.y - a.y * b.x);
00298 }
|
|
||||||||||||||||||||||||
|
Definition at line 705 of file vecmath.h. Referenced by Matrix3< T >::inverse(). 00706 {
00707 return a * d - b * c;
00708 }
|
|
||||||||||||||||
|
Definition at line 564 of file vecmath.h. 00565 {
00566 return a * b;
00567 }
|
|
||||||||||||||||
|
Definition at line 288 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 1011 of file vecmath.h. References MATMUL. 01013 {
01014 #define MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C + a[R].w * b[3].C)
01015 return Matrix4<T>(Vector4<T>(MATMUL(0, x), MATMUL(0, y), MATMUL(0, z), MATMUL(0, w)),
01016 Vector4<T>(MATMUL(1, x), MATMUL(1, y), MATMUL(1, z), MATMUL(1, w)),
01017 Vector4<T>(MATMUL(2, x), MATMUL(2, y), MATMUL(2, z), MATMUL(2, w)),
01018 Vector4<T>(MATMUL(3, x), MATMUL(3, y), MATMUL(3, z), MATMUL(3, w)));
01019 #undef MATMUL
01020 }
|
|
||||||||||||||||
|
Definition at line 992 of file vecmath.h. 00993 {
00994 return Vector4<T>(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z + m.r[3].x * v.w,
00995 m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z + m.r[3].y * v.w,
00996 m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z + m.r[3].z * v.w,
00997 m.r[0].w * v.x + m.r[1].w * v.y + m.r[2].w * v.z + m.r[3].w * v.w);
00998 }
|
|
||||||||||||||||
|
Definition at line 983 of file vecmath.h. 00984 {
00985 return Vector4<T>(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z + m.r[0].w * v.w,
00986 m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z + m.r[1].w * v.w,
00987 m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z + m.r[2].w * v.w,
00988 m.r[3].x * v.x + m.r[3].y * v.y + m.r[3].z * v.z + m.r[3].w * v.w);
00989 }
|
|
||||||||||||||||
|
Definition at line 975 of file vecmath.h. 00976 {
00977 return Point3<T>(m.r[0].x * p.x + m.r[1].x * p.y + m.r[2].x * p.z + m.r[3].x,
00978 m.r[0].y * p.x + m.r[1].y * p.y + m.r[2].y * p.z + m.r[3].y,
00979 m.r[0].z * p.x + m.r[1].z * p.y + m.r[2].z * p.z + m.r[3].z);
00980 }
|
|
||||||||||||||||
|
Definition at line 967 of file vecmath.h. 00968 {
00969 return Point3<T>(m.r[0].x * p.x + m.r[0].y * p.y + m.r[0].z * p.z + m.r[0].w,
00970 m.r[1].x * p.x + m.r[1].y * p.y + m.r[1].z * p.z + m.r[1].w,
00971 m.r[2].x * p.x + m.r[2].y * p.y + m.r[2].z * p.z + m.r[2].w);
00972 }
|
|
||||||||||||||||
|
Definition at line 959 of file vecmath.h. 00960 {
00961 return Vector3<T>(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z,
00962 m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z,
00963 m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z);
00964 }
|
|
||||||||||||||||
|
Definition at line 951 of file vecmath.h. 00952 {
00953 return Vector3<T>(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z,
00954 m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z,
00955 m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z);
00956 }
|
|
||||||||||||||||
|
Definition at line 669 of file vecmath.h. References MATMUL. 00671 {
00672 #define MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C)
00673 return Matrix3<T>(Vector3<T>(MATMUL(0, x), MATMUL(0, y), MATMUL(0, z)),
00674 Vector3<T>(MATMUL(1, x), MATMUL(1, y), MATMUL(1, z)),
00675 Vector3<T>(MATMUL(2, x), MATMUL(2, y), MATMUL(2, z)));
00676 #undef MATMUL
00677 }
|
|
||||||||||||||||
|
Definition at line 661 of file vecmath.h. 00662 {
00663 return Point3<T>(m.r[0].x * p.x + m.r[1].x * p.y + m.r[2].x * p.z,
00664 m.r[0].y * p.x + m.r[1].y * p.y + m.r[2].y * p.z,
00665 m.r[0].z * p.x + m.r[1].z * p.y + m.r[2].z * p.z);
00666 }
|
|
||||||||||||||||
|
Definition at line 652 of file vecmath.h. 00653 {
00654 return Point3<T>(m.r[0].x * p.x + m.r[0].y * p.y + m.r[0].z * p.z,
00655 m.r[1].x * p.x + m.r[1].y * p.y + m.r[1].z * p.z,
00656 m.r[2].x * p.x + m.r[2].y * p.y + m.r[2].z * p.z);
00657 }
|
|
||||||||||||||||
|
Definition at line 643 of file vecmath.h. 00644 {
00645 return Vector3<T>(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z,
00646 m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z,
00647 m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z);
00648 }
|
|
||||||||||||||||
|
Definition at line 634 of file vecmath.h. 00635 {
00636 return Vector3<T>(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z,
00637 m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z,
00638 m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z);
00639 }
|
|
||||||||||||||||
|
Definition at line 559 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 553 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 548 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 399 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 394 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 259 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 253 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 248 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 505 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 473 of file vecmath.h. References Vector3< T >::x, and Vector3< T >::y.
|
|
||||||||||||||||
|
Definition at line 449 of file vecmath.h. References Vector3< T >::x, and Vector3< T >::y.
|
|
||||||||||||||||
|
Definition at line 376 of file vecmath.h. References Point3< T >::x, Point3< T >::y, and Point3< T >::z.
|
|
||||||||||||||||
|
Definition at line 277 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 1023 of file vecmath.h. 01024 {
01025 return Matrix4<T>(a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]);
01026 }
|
|
||||||||||||||||
|
Definition at line 680 of file vecmath.h. 00682 {
00683 return Matrix3<T>(a.r[0] + b.r[0],
00684 a.r[1] + b.r[1],
00685 a.r[2] + b.r[2]);
00686 }
|
|
||||||||||||||||
|
Definition at line 538 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 381 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 238 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 543 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 386 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 348 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 243 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 282 of file vecmath.h.
|
|
||||||||||||||||
|
Definition at line 500 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 468 of file vecmath.h. References Vector3< T >::x, and Vector3< T >::y.
|
|
||||||||||||||||
|
Definition at line 444 of file vecmath.h. References Vector3< T >::x, and Vector3< T >::y.
|
|
||||||||||||||||
|
Definition at line 371 of file vecmath.h. References Point3< T >::x, Point3< T >::y, and Point3< T >::z.
|
|
||||||||||||||||
|
Definition at line 272 of file vecmath.h. References Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.
|
|
||||||||||||||||
|
Definition at line 265 of file vecmath.h. 00266 {
00267 return Vector3<T>(a.y * b.z - a.z * b.y,
00268 a.z * b.x - a.x * b.z,
00269 a.x * b.y - a.y * b.x);
00270 }
|
1.4.1