我有一个问题,我不确定为什么。我需要添加 float3 值。
float3 a3 = cross(v1v2,intersection.pIntersect);
a3.normalize();
float3 lambda1 = a3 / (a1+a2+a3);
error: no match for ‘operator/’ in ‘a3 / math::operator+((* & math::operator+(((const math::vector)(& a3)))’
因此无法对 float3 值进行 + 操作。我的 lambda 类型有误吗?还是我错过了之前的手术?还是 normilize() 方法改变了 typ ?
感谢任何帮助:)
最佳答案
我认为您的问题不在于operator+,而在于operator/
我现在无法检查代码,但似乎你不能划分两个 vector 。
编辑 1
编译器似乎正在将 float3 转换为 math::vector 以用于 operator+。转换之后,它找不到运算符/(float3, math::vector)。
也许“cutil_math.h”不包括在内,尽管看起来 this header is missing for newer SDKs .
关于c++ - OpenCV:运算符 "+"错误;添加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16367745/