PeriDyno 1.0.0
Loading...
Searching...
No Matches
Transform2x2.h
Go to the documentation of this file.
1#pragma once
2#include "Quat.h"
3#include "Matrix2x2.h"
4namespace dyno {
5
6 template <typename T, int Dim> class Vector;
7
8 /*
9 * SquareMatrix<T,3> are defined for C++ fundamental integers types and floating-point types
10 */
11 template <typename T>
12 class Transform<T, 2>
13 {
14 public:
15 typedef T VarType;
16
17 DYN_FUNC Transform();
18 DYN_FUNC Transform(const Vector<T, 2>& t, const T& angle, const Vector<T, 2>& s = Vector<T, 2>(1));
19 DYN_FUNC Transform(const Vector<T, 2>& t, const SquareMatrix<T, 2>& m, const Vector<T, 2>& s = Vector<T, 2>(1));
20
21 DYN_FUNC Transform(const Transform<T, 2>&);
22 DYN_FUNC ~Transform();
23
24 DYN_FUNC static unsigned int rows() { return 2; }
25 DYN_FUNC static unsigned int cols() { return 2; }
26
27 DYN_FUNC inline SquareMatrix<T, 2>& rotation() { return mRotation; }
28 DYN_FUNC inline const SquareMatrix<T, 2> rotation() const { return mRotation; }
29
30 DYN_FUNC inline Vector<T, 2>& translation() { return mTranslation; }
31 DYN_FUNC inline const Vector<T, 2> translation() const { return mTranslation; }
32
33 DYN_FUNC inline Vector<T, 2>& scale() { return mScale; }
34 DYN_FUNC inline const Vector<T, 2> scale() const { return mScale; }
35
36 DYN_FUNC const Vector<T, 2> operator* (const Vector<T, 2> &) const;
37
38 protected:
39 Vector<T, 2> mTranslation; //default: zero matrix
42 };
43
44 template class Transform<float, 2>;
45 template class Transform<double, 2>;
46 //convenient typedefs
49} //end of namespace dyno
50
51#include "Transform2x2.inl"
Implementation of quaternion.
static DYN_FUNC unsigned int rows()
SquareMatrix< T, 2 > mRotation
DYN_FUNC SquareMatrix< T, 2 > & rotation()
Vector< T, 2 > mScale
DYN_FUNC const Vector< T, 2 > scale() const
DYN_FUNC const Vector< T, 2 > translation() const
Vector< T, 2 > mTranslation
DYN_FUNC Vector< T, 2 > & scale()
DYN_FUNC const SquareMatrix< T, 2 > rotation() const
DYN_FUNC Vector< T, 2 > & translation()
static DYN_FUNC unsigned int cols()
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
DYN_FUNC const Complex< T > operator*(S scale, const Complex< T > &complex)
Definition Complex.inl:247
Transform< float, 2 > Transform2f
Transform< double, 2 > Transform2d