PeriDyno 1.0.0
Loading...
Searching...
No Matches
rigid_2d.h
Go to the documentation of this file.
1#pragma once
2#include <iostream>
3#include "rigid_base.h"
4#include "../Vector.h"
5#include "../Matrix.h"
6
7namespace dyno {
8 template <typename T>
9 class Rigid<T, 2>
10 {
11 public:
13 typedef T RotationDOF;
14
15 DYN_FUNC Rigid()
16 : m_p(0)
17 , m_angle(0)
18 {};
19
20 DYN_FUNC Rigid(Vector<T, 2> p, T angle)
21 : m_p(p)
22 , m_angle(angle)
23 {};
24
25 DYN_FUNC ~Rigid() {};
26
27 DYN_FUNC T getOrientation() const { return m_angle; }
28 DYN_FUNC Vector<T, 2> getCenter() const { return m_p; }
30 return SquareMatrix<T, 2>(glm::cos(m_angle), -glm::sin(m_angle),
31 glm::sin(m_angle), glm::cos(m_angle));
32 }
33 private:
36 };
37
38 template class Rigid<float, 2>;
39 template class Rigid<double, 2>;
40 //convenient typedefs
43
44} //end of namespace dyno
DYN_FUNC T getOrientation() const
Definition rigid_2d.h:27
DYN_FUNC SquareMatrix< T, 2 > getRotationMatrix() const
Definition rigid_2d.h:29
Vector< T, 2 > TranslationDOF
Definition rigid_2d.h:12
DYN_FUNC ~Rigid()
Definition rigid_2d.h:25
Vector< T, 2 > m_p
Definition rigid_2d.h:34
DYN_FUNC Vector< T, 2 > getCenter() const
Definition rigid_2d.h:28
DYN_FUNC Rigid()
Definition rigid_2d.h:15
DYN_FUNC Rigid(Vector< T, 2 > p, T angle)
Definition rigid_2d.h:20
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Rigid< float, 2 > Rigid2f
Definition rigid_2d.h:41
Rigid< double, 2 > Rigid2d
Definition rigid_2d.h:42