Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glm::dot returns a vector

My vectors are declared as follows:

std::vector<double> vec1;
std::vector<double> vec2;

double result = glm::dot(vec1, vec2);

I receive the following error: error: no viable conversion from 'std::__1::vector<double, std::__1::allocator<double> >' to 'double'

Shouldn't glm::dot return a scalar value (a double) in this case?

like image 825
adrianp Avatar asked Oct 17 '25 03:10

adrianp


1 Answers

I may be mistaking myself, but this error must come from the argument type, not the return type , glm::dot has never taken any std::vector as argument, and as it's not a vec2 or vec3, etc. (not a glm type), it may try to cast it to a 1 dimension value to perform a 1 dimension scalar product

like image 200
Archie Avatar answered Oct 18 '25 16:10

Archie