Function 在my main.cpp中调用函数
我试图在main.cpp文件中调用此函数,有什么建议吗Function 在my main.cpp中调用函数,function,c++11,point,Function,C++11,Point,我试图在main.cpp文件中调用此函数,有什么建议吗 // get new reflected direction point ReflectivePlane::reflect( ray r ) { assert( std::fabs( eval( r.pos ) ) <std::numeric_limits<float>::epsilon()); point u = r.dir; double t = 2.0 * ( a * u.x + b * u.y +
// get new reflected direction
point ReflectivePlane::reflect( ray r ) {
assert( std::fabs( eval( r.pos ) ) <std::numeric_limits<float>::epsilon());
point u = r.dir;
double t = 2.0 * ( a * u.x + b * u.y + c * u.z ) / ( a*a + b*b + c*c );
return point( u.x - a*t, u.y - b*t, u.z - c*t );
}
//获取新的反射方向
点反射平面::反射(光线r){
assert(std::fabs(eval(r.pos))创建ReflectivePlane的实例(对象)。
创建光线对象;
然后调用这个方法
反射平面rp(*此处可能有一些参数*);
雷r(*这里可能有一些参数*)
rp.reflect(r)