From 0a02250a858088a7c12a7e93ca367cda0c7114b2 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Wed, 20 Mar 2024 20:52:09 +0100 Subject: [PATCH] Change default initialization for Quaternions to 1 + 0i + 0j + 0k The current initialization is not representing a pure rotation as it is not normalized. Change this to the identity quaternion 1 + 0i + 0j + 0k, i.e., Q(w = 1, x = 0, y = 0, z = 0), to be consistent with the needs of the Molecule interface. Note: Initialisation to Q(0,0,0,0) might show some performance improvement over Q(1,0,0,0) but tests showed neglectable influence on the overall performance of ls1. So we stay with the safe and convenient solution. Signed-off-by: Christoph Niethammer --- src/molecules/Quaternion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/molecules/Quaternion.h b/src/molecules/Quaternion.h index c537c3968a..e7c65161fa 100644 --- a/src/molecules/Quaternion.h +++ b/src/molecules/Quaternion.h @@ -9,7 +9,7 @@ */ class Quaternion { public: - Quaternion(double qw = 1., double qx = 1., double qy = 0., double qz = 0.) + Quaternion(double qw = 1., double qx = 0., double qy = 0., double qz = 0.) : m_qw(qw), m_qx(qx), m_qy(qy), m_qz(qz) { }