Darc Library  2012.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
darc::core Namespace Reference

Classes

class  IAttribute
 Interface for template attributes. More...
class  CR_Attribute_TN
 Template attribute class. More...
class  CR_AttributeManager
 Manager class to store, Read and Write single or array attributes. More...
class  KeyGroup
class  KeyGroupContainer_GE
 Container class generating all printable key groups in the German language. More...
class  KeyGroupContainer_EN
 Container class generating all printable key groups in the English language. More...
class  InputEvent
class  KeyboardEvent
class  KeyEvent
class  Key
class  IKeyboardScanner
 Short. More...
class  IKeyGroupTable
 Interface class for scan code translation. More...
struct  Traits< Matrix< T, M, N > >
struct  Storage
 Default type uses row order storage. More...
struct  Storage< T, M, 0 >
 Storage with variable number of columns. More...
class  BaseMatrix
class  Matrix
class  Matrix4D_T
class  Matrix3D_T
class  Matrix2D_T
class  CR_Matrix
 Template matrix class for M(rows)-by-N(columns)-dimensional matrices of arbitrary type. More...
class  GE_Quaternion
class  GE_Segment3D
class  GE_Segment2D
class  GE_Tetrahdron
class  Triangle_M
 Template class for M-dimensional triangles and arbitrary types. Vertex data is stored externally. More...
class  Triangle3D_Ex
class  Triangle2D
class  Vector
class  Vector3D_T
class  Vector2D_T

Typedefs

typedef IAttributeCR_PIAttribute
typedef Matrix4D_T< RealMatrix4D
typedef Matrix3D_T< RealMatrix3D
typedef Matrix2D_T< RealMatrix2D
typedef CR_Matrix< RealGE_Matrix
typedef GE_Segment3D GE_Ray3D
typedef GE_Segment3D GE_Line3D
typedef Triangle_M< Real, 3 > Triangle3D
typedef Triangle3D GE_Plane3D
typedef Vector< Real, 4 > Vector4D
typedef Vector< Real, 6 > Vector6D
typedef Vector3D_T< RealVector3D
typedef Vector3D_T< UIntVector3DUI
typedef Vector2D_T< RealCR_Vector2D
typedef Vector2D_T< UIntVectorUI2D
typedef Vector2D_T< IntVectorI2D

Enumerations

enum  {
  BASE_ESCAPE, BASE_F1, BASE_F2, BASE_F3,
  BASE_F4, BASE_F5, BASE_F6, BASE_F7,
  BASE_F8, BASE_F9, BASE_F10, BASE_F11,
  BASE_F12, BASE_F13, BASE_F14, BASE_F15,
  BASE_CIRCUMFLEX, BASE_1, BASE_2, BASE_3,
  BASE_4, BASE_5, BASE_6, BASE_7,
  BASE_8, BASE_9, BASE_0, BASE_SHARPS,
  BASE_ACUTE, BASE_BACKSPACE, BASE_TAB, BASE_Q,
  BASE_W, BASE_E, BASE_R, BASE_T,
  BASE_Z, BASE_U, BASE_I, BASE_O,
  BASE_P, BASE_U_UMLAUT, BASE_PLUS, BASE_CAPS,
  BASE_A, BASE_S, BASE_D, BASE_F,
  BASE_G, BASE_H, BASE_J, BASE_K,
  BASE_L, BASE_O_UMLAUT, BASE_A_UMLAUT, BASE_HASH,
  BASE_SHIFT_LEFT, BASE_CHEVRON_LEFT, BASE_Y, BASE_X,
  BASE_C, BASE_V, BASE_B, BASE_N,
  BASE_M, BASE_COMMA, BASE_PERIOD, BASE_HYPEN,
  BASE_SHIFT_RIGHT, BASE_CTRL_LEFT, BASE_WIN_LEFT, BASE_ALT_LEFT,
  BASE_SPACE, BASE_ALT_RIGHT, BASE_WIN_RIGHT, BASE_CTRL_RIGHT,
  BASE_ARROW_LEFT, BASE_ARROW_RIGHT, BASE_ARROW_UP, BASE_ARROW_DOWN,
  BASE_NUM_LOCK, BASE_NUM_ADD, BASE_NUM_SUB, BASE_NUM_MULT,
  BASE_NUM_DIV
}
enum  E_COORD { X = 0, Y = 1, Z = 2, W = 3 }
 Enumeration of axis symbols up to homogeneous 4-dimensional vectors. More...
enum  E_INDEX {
  CR_A = 0, CR_B = 1, CR_C = 2, CR_D = 3,
  CR_E = 4, CR_F = 5
}
 Enumeration of array indices using alphabetical identifiers. More...
enum  E_EXTENT { CR_X_MIN = 0, CR_X_MAX = 1, CR_Y_MIN = 2 }
 Enumeration of axis aligned boundaries. More...
enum  E_LANG { CR_GERMAN, CR_ENGLISH }

Functions

CR_API ostream & operator<< (ostream &_o, const IAttribute &_obj)
CR_API ostream & operator<< (ostream &_o, const CR_AttributeManager &_obj)
CR_API std::ostream & operator<< (std::ostream &_o, const IAttribute &_obj)
CR_API std::ostream & operator<< (std::ostream &_o, const CR_AttributeManager &_obj)
template<>
const BaseMatrix< Matrix
< float, 4, 4 > > 
operator* (const BaseMatrix< Matrix< float, 4, 4 > > &_m0, const BaseMatrix< Matrix< float, 4, 4 > > &_m1)
 Operator "Matrix multiplication" for 4-dimensional matrices using SIMD.
CR_API Matrix4D CR_Matrix4D_Identity ()
CR_API Real Matrix4D_Det (const Matrix4D &_m)
CR_API Real Matrix4D_Det3 (const Matrix4D &_mIn)
CR_API Matrix4D Matrix4D_Invert (const Matrix4D &_m)
CR_API Matrix4D ge_Matrix4D_transpose (const Matrix4D &_m)
CR_API Matrix4D ge_Matrix4D_TR_invert (const Matrix4D &_m)
CR_API Matrix4D ge_Matrix4D_translation (const Real &_x, const Real &_y, const Real &_z)
CR_API void ge_Matrix4D_translation (Matrix4D *_m, Real _x, Real _y, Real _z)
CR_API float Matrix4D_Det2 (const Matrix4D &_m)
CR_API void Matrix4D_Invert2 (float *src)
CR_API Matrix4D ge_Matrix4D_projectionLH (const Real &_viewY, const Real &_ratio, const Real &_zn, const Real &_zf)
CR_API Matrix4D ge_Matrix4D_frustumLH (const Real _l, const Real _r, const Real _b, const Real _t, const Real _n, const Real _f)
CR_API Matrix4D ge_Matrix4D_orthogonalLH (const Real _w, const Real _h, const Real &_zn, const Real &_zf)
CR_API Matrix4D ge_Matrix4D_orthogonalOffLH (const Real _l, const Real _r, const Real _b, const Real _t, const Real &_zn, const Real &_zf)
CR_API Matrix4D CR_Matrix4D_rotX (const Real &_r)
CR_API Matrix4D CR_Matrix4D_rotY (const Real &_r)
CR_API Matrix4D CR_Matrix4D_RotZ (const Real &_r)
CR_API Matrix3D ge_Matrix3D_rot (const Real &_r)
template<typename T , UInt M, UInt N, UInt O>
const BaseMatrix< Matrix< T, M,
O > > 
operator* (const BaseMatrix< Matrix< T, M, N > > &_m0, const BaseMatrix< Matrix< T, N, O > > &_m1)
 Operator "Multiplication" (default).
template<typename T , int M, int N>
const BaseMatrix< Matrix< T, M,
N > > 
operator* (const T &_s, const BaseMatrix< Matrix< T, M, N > > &_m)
 Operator "Scalar multiplication (left)".
template<typename T , int M, int N>
const BaseMatrix< Matrix< T, M,
N > > 
operator* (const BaseMatrix< Matrix< T, M, N > > &_m, const T &_s)
 Operator "Scalar multiplication (right)".
template<typename T , int M, int N>
const BaseMatrix< Matrix< T, M,
N > > & 
operator*= (BaseMatrix< Matrix< T, M, N > > &_v, const T &_s)
 Operator "Scalar multiplication (compound)".
template<typename T , int M, int N>
const BaseMatrix< Matrix< T, M,
N > > 
operator+ (const BaseMatrix< Matrix< T, M, N > > &_m0, const BaseMatrix< Matrix< T, M, N > > &_m1)
 Operator "Vector addition".
template<typename T , int M, int N>
const bool operator< (const BaseMatrix< Matrix< T, M, N > > &_m0, const BaseMatrix< Matrix< T, M, N > > &_m1)
 Operator "Less".
template<typename D >
std::ostream & operator<< (std::ostream &_o, const BaseMatrix< D > &_m)
 Operator "Stream out".
CR_API void cr_Matrix4D_multiply_sse2 (const Matrix4D &_m0, const Matrix4D &_m1, Matrix4D &_mOut)
CR_API void ge_Matrix4D_multiply2 (const Real *_m0, const Real *_m1, Real *_mOut)
CR_API Matrix3D ge_Matrix3D_translation (const Real &_x, const Real &_y)
template<typename T >
const CR_Matrix< T > operator* (const CR_Matrix< T > &_m1, const CR_Matrix< T > &_m2)
 Operator "Matrix * Matrix multiplication".
template<typename T >
std::ostream & operator<< (std::ostream &_o, const CR_Matrix< T > &_m)
CR_API Matrix4D ge_Quaternion_toMatrix4D (const GE_Quaternion &_q)
CR_API GE_Quaternion ge_Quaternion_rotation (const Real &_r, const Vector3D &_v)
CR_API void Vector3D_Cross (const Vector3D &_v0, const Vector3D &_v1, Vector3D &_vOut)
CR_API float Vector3D_Angle (const Vector3D &_v0, const Vector3D &_v1)
template<>
const BaseMatrix< Matrix
< float, 4, 1 > > 
operator* (const BaseMatrix< Matrix< float, 4, 1 > > &_v, const float &_s)
 Operator "Scalar multiplication (right)" for 4-dimensional vectors using SIMD.
template<typename T , int M>
const Real operator* (const Vector< T, M > &_v0, const Vector< T, M > &_v1)
 Operator "Dot product".
template<typename T , int M>
Vector< T, M > operator- (const Vector< T, M > &_v0, const Vector< T, M > &_v1)
 Operator "Vector subtraction".

Typedef Documentation


Enumeration Type Documentation

anonymous enum
Enumerator:
BASE_ESCAPE 
BASE_F1 
BASE_F2 
BASE_F3 
BASE_F4 
BASE_F5 
BASE_F6 
BASE_F7 
BASE_F8 
BASE_F9 
BASE_F10 
BASE_F11 
BASE_F12 
BASE_F13 
BASE_F14 
BASE_F15 
BASE_CIRCUMFLEX 
BASE_1 
BASE_2 
BASE_3 
BASE_4 
BASE_5 
BASE_6 
BASE_7 
BASE_8 
BASE_9 
BASE_0 
BASE_SHARPS 
BASE_ACUTE 
BASE_BACKSPACE 
BASE_TAB 
BASE_Q 
BASE_W 
BASE_E 
BASE_R 
BASE_T 
BASE_Z 
BASE_U 
BASE_I 
BASE_O 
BASE_P 
BASE_U_UMLAUT 
BASE_PLUS 
BASE_CAPS 
BASE_A 
BASE_S 
BASE_D 
BASE_F 
BASE_G 
BASE_H 
BASE_J 
BASE_K 
BASE_L 
BASE_O_UMLAUT 
BASE_A_UMLAUT 
BASE_HASH 
BASE_SHIFT_LEFT 
BASE_CHEVRON_LEFT 
BASE_Y 
BASE_X 
BASE_C 
BASE_V 
BASE_B 
BASE_N 
BASE_M 
BASE_COMMA 
BASE_PERIOD 
BASE_HYPEN 
BASE_SHIFT_RIGHT 
BASE_CTRL_LEFT 
BASE_WIN_LEFT 
BASE_ALT_LEFT 
BASE_SPACE 
BASE_ALT_RIGHT 
BASE_WIN_RIGHT 
BASE_CTRL_RIGHT 
BASE_ARROW_LEFT 
BASE_ARROW_RIGHT 
BASE_ARROW_UP 
BASE_ARROW_DOWN 
BASE_NUM_LOCK 
BASE_NUM_ADD 
BASE_NUM_SUB 
BASE_NUM_MULT 
BASE_NUM_DIV 

Enumeration of axis symbols up to homogeneous 4-dimensional vectors.

Enumerator:
X 

X-Axis.

Y 

Y-Axis.

Z 

Z-Axis.

W 

Homogenous coordinate.

Enumeration of axis aligned boundaries.

Enumerator:
CR_X_MIN 

Minimum extent on the X-axis.

CR_X_MAX 

Maximum extent on the X-axis.

CR_Y_MIN 

Minimum extent on the Y-axis.

Enumeration of array indices using alphabetical identifiers.

Enumerator:
CR_A 
CR_B 
CR_C 
CR_D 
CR_E 
CR_F 
Enumerator:
CR_GERMAN 
CR_ENGLISH 

Function Documentation

Creates an identity matrix.

CR_API void darc::core::cr_Matrix4D_multiply_sse2 ( const Matrix4D &  _m0,
const Matrix4D &  _m1,
Matrix4D &  _mOut 
)

Use 16 byte aligned objects only.

Right handed - positive

Right handed - positive

Right handed - positive

CR_API Matrix3D darc::core::ge_Matrix3D_translation ( const Real &  _x,
const Real &  _y 
)
CR_API Matrix4D darc::core::ge_Matrix4D_frustumLH ( const Real  _l,
const Real  _r,
const Real  _b,
const Real  _t,
const Real  _n,
const Real  _f 
)

Creates the left handed equivalent to glFrustum. Confirmed.

CR_API void darc::core::ge_Matrix4D_multiply2 ( const Real *  _m0,
const Real *  _m1,
Real *  _mOut 
)
CR_API Matrix4D darc::core::ge_Matrix4D_orthogonalLH ( const Real  _w,
const Real  _h,
const Real &  _zn,
const Real &  _zf 
)

Creates a transposed orthogonal projection matrix. Direct X usually uses transposed matrices in row order which is equivalent to non-transposed matrices in column order. However the Direct X projection matrix is an exception.

CR_API Matrix4D darc::core::ge_Matrix4D_orthogonalOffLH ( const Real  _l,
const Real  _r,
const Real  _b,
const Real  _t,
const Real &  _zn,
const Real &  _zf 
)
CR_API Matrix4D darc::core::ge_Matrix4D_projectionLH ( const Real &  _viewY,
const Real &  _ratio,
const Real &  _zn,
const Real &  _zf 
)

Creates a transposed perspective field of view projection matrix. Direct X usually uses transposed matrices in row order which is equivalent to non-transposed matrices in column order. However the Direct X projection matrix is an exception.

Operator "Matrix4D * CR_Vector3D multiplication". Operator "Matrix3D * CR_Vector2D multiplication". Creates a perspective projection matrix.

Only for matrices composed of a translational part multiplied with a rotational part M = T*R -> inv(M) = inv(R) * inv(T).

Only for matrices composed of translational part multiplied with a rotational part.

CR_API Matrix4D darc::core::ge_Matrix4D_translation ( const Real &  _x,
const Real &  _y,
const Real &  _z 
)

Creates a translation matrix.

CR_API void darc::core::ge_Matrix4D_translation ( Matrix4D *  _m,
Real  _x,
Real  _y,
Real  _z 
)

Returns transposed matrix.

CR_API GE_Quaternion darc::core::ge_Quaternion_rotation ( const Real &  _r,
const Vector3D &  _v 
)
CR_API Matrix4D darc::core::ge_Quaternion_toMatrix4D ( const GE_Quaternion &  _q)
CR_API Real darc::core::Matrix4D_Det ( const Matrix4D &  _m)

Determinant of upper 3x3 block.

CR_API float darc::core::Matrix4D_Det2 ( const Matrix4D &  _m)
CR_API Real darc::core::Matrix4D_Det3 ( const Matrix4D &  _mIn)
CR_API Matrix4D darc::core::Matrix4D_Invert ( const Matrix4D &  _m)

Returns inverted matrix if possible.

CR_API void darc::core::Matrix4D_Invert2 ( float *  src)
template<>
CR_API const BaseMatrix< Matrix< float, 4, 4 > > darc::core::operator* ( const BaseMatrix< Matrix< float, 4, 4 > > &  _m0,
const BaseMatrix< Matrix< float, 4, 4 > > &  _m1 
)

Operator "Matrix multiplication" for 4-dimensional matrices using SIMD.

Runtime factor in comparison with the D3D implementation is 1.1 (SIMD/D3D). Runtime factor in comparison with the default implementation is 0.14 (SIMD/default).

template<>
CR_API const BaseMatrix< Matrix< float, 4, 1 > > darc::core::operator* ( const BaseMatrix< Matrix< float, 4, 1 > > &  _v,
const float &  _s 
)

Operator "Scalar multiplication (right)" for 4-dimensional vectors using SIMD.

Runtime in comparison with the default implementation is 0.82 (SIMD/default).

template<typename T , int M>
const Real darc::core::operator* ( const Vector< T, M > &  _v0,
const Vector< T, M > &  _v1 
)

Operator "Dot product".

template<typename T >
const CR_Matrix<T> darc::core::operator* ( const CR_Matrix< T > &  _m1,
const CR_Matrix< T > &  _m2 
)

Operator "Matrix * Matrix multiplication".

template<typename T , UInt M, UInt N, UInt O>
const BaseMatrix<Matrix<T,M,O> > darc::core::operator* ( const BaseMatrix< Matrix< T, M, N > > &  _m0,
const BaseMatrix< Matrix< T, N, O > > &  _m1 
)

Operator "Multiplication" (default).

template<typename T , int M, int N>
const BaseMatrix<Matrix<T,M,N> > darc::core::operator* ( const T &  _s,
const BaseMatrix< Matrix< T, M, N > > &  _m 
)

Operator "Scalar multiplication (left)".

template<typename T , int M, int N>
const BaseMatrix<Matrix<T,M,N> > darc::core::operator* ( const BaseMatrix< Matrix< T, M, N > > &  _m,
const T &  _s 
)

Operator "Scalar multiplication (right)".

template<typename T , int M, int N>
const BaseMatrix<Matrix<T,M,N> >& darc::core::operator*= ( BaseMatrix< Matrix< T, M, N > > &  _v,
const T &  _s 
)

Operator "Scalar multiplication (compound)".

template<typename T , int M, int N>
const BaseMatrix<Matrix<T,M,N> > darc::core::operator+ ( const BaseMatrix< Matrix< T, M, N > > &  _m0,
const BaseMatrix< Matrix< T, M, N > > &  _m1 
)

Operator "Vector addition".

template<typename T , int M>
Vector<T,M> darc::core::operator- ( const Vector< T, M > &  _v0,
const Vector< T, M > &  _v1 
)

Operator "Vector subtraction".

template<typename T , int M, int N>
const bool darc::core::operator< ( const BaseMatrix< Matrix< T, M, N > > &  _m0,
const BaseMatrix< Matrix< T, M, N > > &  _m1 
)

Operator "Less".

This operator is needed for a defined order between matrix objects, e.g., in sorted sets or maps.

CR_API ostream& darc::core::operator<< ( ostream &  _o,
const IAttribute &  _obj 
)
CR_API ostream& darc::core::operator<< ( ostream &  _o,
const CR_AttributeManager &  _obj 
)
CR_API std::ostream& darc::core::operator<< ( std::ostream &  _o,
const IAttribute &  _obj 
)

Operator "Stream out".

template<typename T >
std::ostream& darc::core::operator<< ( std::ostream &  _o,
const CR_Matrix< T > &  _m 
)
template<typename D >
std::ostream& darc::core::operator<< ( std::ostream &  _o,
const BaseMatrix< D > &  _m 
)

Operator "Stream out".

CR_API std::ostream& darc::core::operator<< ( std::ostream &  _o,
const CR_AttributeManager &  _obj 
)
CR_API float darc::core::Vector3D_Angle ( const Vector3D &  _v0,
const Vector3D &  _v1 
)
CR_API void darc::core::Vector3D_Cross ( const Vector3D &  _v0,
const Vector3D &  _v1,
Vector3D &  _vOut 
)