Laar's picture

Conversion of Math types

Project:The Open Toolkit library
Category:feature request

The Vector and matrix classes cannot convert from double to float variants or visa versa (nor from the half to float or double). This conversion is essential as the GL... calls don't use the double types.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
swiftcoder's picture


I find it to be a fairly rare need in practice, but I could also use this functionality, on occasion.

vicviper's picture


There's a case where I usually need conversion between flat to double and back:

if at some point I need to do an inverse projection (for example, to project the mouse coordinates into 3D space) I usually need to do all the operations in double precission, because simple precission produces a lot of error in the resulting 3D point. So it is common to take the camera, projection, viewport matrices, convert to double and do the operation with the double clones.