PeriDyno 1.0.0
Loading...
Searching...
No Matches
ParametricModel.h
Go to the documentation of this file.
1
16
17#pragma once
18#include "Node.h"
19
20#include "Quat.h"
21
23
24namespace dyno
25{
26 template<typename TDataType>
27 class ParametricModel : virtual public Node
28 {
29 public:
30 typedef typename TDataType::Real Real;
31 typedef typename TDataType::Coord Coord;
32
34
36 {
37 auto rot = this->varRotation()->getValue();
38
39 Quat<Real> q =
40 Quat<Real>(Real(M_PI) * rot[2] / 180, Coord(0, 0, 1))
41 * Quat<Real>(Real(M_PI) * rot[1] / 180, Coord(0, 1, 0))
42 * Quat<Real>(Real(M_PI) * rot[0] / 180, Coord(1, 0, 0));
43 q.normalize();
44 return q;
45 }
46
47 public:
48 DEF_VAR(Coord, Location, 0, "Node location");
49 DEF_VAR(Coord, Rotation, 0, "Node rotation");
50 DEF_VAR(Coord, Scale, Coord(1), "Node scale");
51 };
52}
Implementation of quaternion.
#define M_PI
Definition Typedef.inl:36
TDataType::Coord Coord
DEF_VAR(Coord, Scale, Coord(1), "Node scale")
DEF_VAR(Coord, Rotation, 0, "Node rotation")
Quat< Real > computeQuaternion()
DEF_VAR(Coord, Location, 0, "Node location")
DYN_FUNC Quat< Real > & normalize()
Definition Quat.inl:183
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25