TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Matrix.cpp File Reference
#include "G3D/Matrix.h"
#include "G3D/TextOutput.h"
+ Include dependency graph for Matrix.cpp:

Namespaces

 G3D
 

Macros

#define INPLACE(OP)
 
#define TRAMPOLINE_EXPLICIT_1(method)
 
#define COMPARE_SCALAR(OP)
 
#define IMPLEMENT_ARRAY_2(method, OP)
 
#define IMPLEMENT_ARRAY_1(method, f)
 
#define IMPLEMENT_ARRAY_SCALAR(method, OP)
 
#define SWAP(x, y)   {float temp = x; x = y; y = temp;}
 
#define SIGN(a, b)   ((b) >= 0.0 ? fabs(a) : -fabs(a))
 

Functions

static G3D::Matrix::T negate (G3D::Matrix::T x)
 
static double G3D::pythag (double a, double b)
 

Detailed Description

Author
Morgan McGuire, http://graphics.cs.williams.edu

Macro Definition Documentation

#define COMPARE_SCALAR (   OP)
Value:
Matrix Matrix::operator OP (const T& scalar) const {\
int R = rows();\
int C = cols();\
int N = R * C;\
Matrix out = Matrix::zero(R, C);\
const T* raw = impl->data;\
T* outRaw = out.impl->data;\
for (int i = 0; i < N; ++i) {\
outRaw[i] = raw[i] OP scalar;\
}\
\
return out;\
}
static unorm16 zero()
Definition: unorm16.h:82
#define const
Definition: zconf.h:217
#define IMPLEMENT_ARRAY_1 (   method,
 
)
Value:
void Matrix::Impl::method(Impl& out) const {\
const Impl& A = *this;\
debugAssert(A.C == out.C);\
debugAssert(A.R == out.R);\
\
for (int i = R * C - 1; i >= 0; --i) {\
out.data[i] = f(A.data[i]);\
}\
}
#define debugAssert(exp)
Definition: debugAssert.h:160
#define const
Definition: zconf.h:217
#define IMPLEMENT_ARRAY_2 (   method,
  OP 
)
Value:
void Matrix::Impl::method(const Impl& B, Impl& out) const {\
const Impl& A = *this;\
debugAssert(A.C == B.C);\
debugAssert(A.R == B.R);\
debugAssert(A.C == out.C);\
debugAssert(A.R == out.R);\
\
for (int i = R * C - 1; i >= 0; --i) {\
out.data[i] = A.data[i] OP B.data[i];\
}\
}
#define debugAssert(exp)
Definition: debugAssert.h:160
#define const
Definition: zconf.h:217
#define IMPLEMENT_ARRAY_SCALAR (   method,
  OP 
)
Value:
void Matrix::Impl::method(Matrix::T B, Impl& out) const {\
const Impl& A = *this;\
debugAssert(A.C == out.C);\
debugAssert(A.R == out.R);\
\
for (int i = R * C - 1; i >= 0; --i) {\
out.data[i] = A.data[i] OP B;\
}\
}
#define debugAssert(exp)
Definition: debugAssert.h:160
#define const
Definition: zconf.h:217
#define INPLACE (   OP)
Value:
ImplRef A = impl;\
\
if (! A.unique()) {\
impl.reset(new Impl(A->R, A->C));\
}\
\
A->OP(B, *impl);
#define SIGN (   a,
 
)    ((b) >= 0.0 ? fabs(a) : -fabs(a))
#define SWAP (   x,
 
)    {float temp = x; x = y; y = temp;}
#define TRAMPOLINE_EXPLICIT_1 (   method)
Value:
void Matrix::method(Matrix& out) const {\
if ((out.impl == impl) && impl.unique()) {\
impl->method(*out.impl);\
} else {\
out = this->method();\
}\
}

Function Documentation

static G3D::Matrix::T negate ( G3D::Matrix::T  x)
inlinestatic
8  {
9  return -x;
10 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function: