projection

v1
Brett 2023-03-10 17:24:00 -05:00
parent 4b4f95af81
commit edfca12b18
1 changed files with 6 additions and 0 deletions

View File

@ -141,6 +141,12 @@ namespace blt {
left.z() * right.x() - left.x() * right.z(), left.z() * right.x() - left.x() * right.z(),
left.x() * right.y() - left.y() * right.x()}; left.x() * right.y() - left.y() * right.x()};
} }
static inline vec<T, size> project(const vec<T, size>& u, const vec<T, size>& v){
float du = dot(u);
float dv = dot(v);
return (du / dv) * v;
}
}; };
template<typename T, unsigned long size> template<typename T, unsigned long size>