sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[Sofa.Type] Constexpr Quaternion

Open fredroy opened this issue 2 years ago • 1 comments

Because... https://www.youtube.com/watch?v=PJwd4JLYJJY (a little bad side-effect is that it is mandatory to inline those if we want to access it from an other TU [dcl.constexpr] §7.1.5/2 and [basic.def.odr] §3.2/4 )

+ cleanups:

  • factorize toOpenGlMatrix
  • remove hard-coded usage of double/float instead of Real
  • surely other things

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

fredroy avatar Aug 16 '22 07:08 fredroy

[ci-build][with-all-tests]

fredroy avatar Aug 16 '22 09:08 fredroy

I removed the ready flag because I not more time and explanation to estimate if having constexpr everywhere is worth the "little bad side-effect is that it is mandatory to inline those".

damienmarchal avatar Aug 23 '22 13:08 damienmarchal

Compilation might be a bit longer @damienmarchal what else would you like to know?

hugtalbot avatar Aug 24 '22 09:08 hugtalbot

up @damienmarchal NB : move Quat::writeOpenGlMatrix in another PR

hugtalbot avatar Aug 26 '22 07:08 hugtalbot

Let's test to define it constexpr while defining it in the inl file (including it in the header) and see if it works as constexpr

hugtalbot avatar Sep 07 '22 08:09 hugtalbot

Due to the fact that math functions are generally not constexpr (abs, sin, tan, cos, sqrt) a lot of fonctions in Quat cannot be used at compile time actually :/ So those have been reverted to "non constexpr"

fredroy avatar Sep 08 '22 04:09 fredroy

[ci-build][with-all-tests]

fredroy avatar Sep 08 '22 04:09 fredroy

Agreement on merge with strong recommendation to add constexpr specific unittest.

damienmarchal avatar Sep 14 '22 08:09 damienmarchal

[ci-build]

damienmarchal avatar Sep 16 '22 13:09 damienmarchal

[ci-build][with-all-tests]

fredroy avatar Sep 19 '22 00:09 fredroy

[ci-build][with-all-tests]

epernod avatar Sep 20 '22 12:09 epernod

[ci-build]

damienmarchal avatar Sep 20 '22 14:09 damienmarchal

[ci-build]

damienmarchal avatar Sep 21 '22 06:09 damienmarchal

[ci-build][with-all-tests]

alxbilger avatar Sep 21 '22 09:09 alxbilger