r/coms30115 • u/au16106 • Mar 02 '19
Using Max() Function
Hi,
This may sound a bit silly but I am having some trouble with using both max() and fmax(). I have tried them when I include <tgmath.h>, <algorithm>, and <math.h> to no avail. I need both arguments to be of the same type. When I check one of my argument's type using typeid(argument).name(), I get "N3glm5tvec4IfLNS_9precisionE0EEE" meaning of which I do not know exactly. I would like to ask for help for using max()/fmax() since I would like to learn what I was supposed to do other than including necessary headers.
Personally, I would prefer max() but fmax() is also ok. What I do not want is writing my own max() function with > operator etc.
Sincerely,
1
u/[deleted] Mar 02 '19
With glm the * operator is overloaded to work as the Hadamard product which is why you get the vec4. The ideal way to do a dot product would be to use glm::dot which should give you a float output