59 mat.translate(translate);
60 mat.rotate(EulerToQuaternion(rotate));
71 mat.translate(translate);
72 mat.rotate(EulerToQuaternion(rotate));
74 mat.rotate(EulerToQuaternion(turn));
83 mat.rotate(EulerToQuaternion(rotateExtrinsic));
84 mat.translate(translate);
85 mat.rotate(EulerToQuaternion(rotate));
87 mat.rotate(EulerToQuaternion(turn));
90 QQuaternion q = EulerToQuaternion(rotateExtrinsic) * EulerToQuaternion(rotate);
91 rotate = QuaternionToEuler(q);
94 translate = EulerToQuaternion(rotateExtrinsic).rotatedVector(translate);
118 float cpsi2 = std::cos(euler.
x / 2.0f);
119 float spsi2 = std::sin(euler.
x / 2.0f);
120 float cth2 = std::cos(euler.
y / 2.0f);
121 float sth2 = std::sin(euler.
y / 2.0f);
122 float cphi2 = std::cos(euler.
z / 2.0f);
123 float sphi2 = std::sin(euler.
z / 2.0f);
124 auto a = cphi2 * cth2 * cpsi2 - sphi2 * cth2 * spsi2;
125 auto b = cphi2 * cpsi2 * sth2 + sphi2 * sth2 * spsi2;
126 auto c = cphi2 * sth2 * spsi2 - sphi2 * cpsi2 * sth2;
127 auto d = cphi2 * cth2 * spsi2 + cth2 * cpsi2 * sphi2;
128 return QQuaternion{a, b, c, d};
133 auto qvec = q.toVector4D();
140 float term1 = std::atan(d / a);
144 term2 =
static_cast<float>(M_PI_2);
146 term2 = std::atan(c / b);
148 float x = term1 + term2;
149 float y = 2 * std::atan(std::sqrt((b * b + c * c) / (a * a + d * d)));
150 float z = term1 - term2;
void draw(QColor const &, QMatrix4x4 const &, Geometry const &)
GeometryHandle getGeometry(GeometricID::Key)
void rem(Object *)
removes an object, the caller becomes responsible
void transform(float scale, Vector3D rotate, Vector3D translate)
void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D &rotate, Vector3D rotateExtrinsic, Vector3D &translate)
GeometryStore & geometryStore()
Real shapes will be parameterized by BaseShape enum and possibly two floats.