1
Feature requests / Make sf::Transform.getMatrix not const.
« on: August 17, 2018, 03:39:06 pm »
This is the use case: when you want to set a translation from something else into a sfml drawable, it's more practical to handle the whole transform at once directly from the source instead of converting and setting every single detail.
For example, bullet3d exposes rigid bodies' transformation both for reading and writing using opengl matrices. So it's much more practical to use getOpenGLMatrix and use this matrix to draw something rather than picking each value, converting and then setting into the transform.
As it stands, one has to cast the const float* into a regular float*, making it for less readable code and maybe performance loss. I didn't check but I wouldn't be surprised, after all it's more stuff being done.
I have an example here:
https://pastebin.com/NxBJJtYr
For example, bullet3d exposes rigid bodies' transformation both for reading and writing using opengl matrices. So it's much more practical to use getOpenGLMatrix and use this matrix to draw something rather than picking each value, converting and then setting into the transform.
As it stands, one has to cast the const float* into a regular float*, making it for less readable code and maybe performance loss. I didn't check but I wouldn't be surprised, after all it's more stuff being done.
I have an example here:
https://pastebin.com/NxBJJtYr