大佬教程收集整理的这篇文章主要介绍了c – 返回值1.#INF000,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
float Ray::Intersects(Bounding@L_696_1@ bounding@L_696_1@) { // direction is unit direction vector of the ray D3DXVECTOR3 dirfrac( 1.0f / direction.x,1.0f / direction.y,1.0f / direction.z); D3DXVECTOR3 min = bounding@L_696_1@.Min(); D3DXVECTOR3 max = bounding@L_696_1@.Max(); //min and max are the negative and positive corners of the bounding @L_696_1@ float t1 = (min.x - origin.X) * dirfrac.x; float t2 = (max.x - origin.X) * dirfrac.x; float t3 = (min.y - origin.y) * dirfrac.y; float t4 = (max.y - origin.y) * dirfrac.y; float t5 = (min.z - origin.z) * dirfrac.z; float t6 = (max.z - origin.z) * dirfrac.z; float tmin = max(max(min(t1,t2),min(t3,t4)),min(t5,t6)); float tmax = min(min(max(t1,max(t3,max(t5,t6)); // if tmax < 0,ray (linE) is intersecTing AABB,but whole AABB is behind us if (tmax < 0) { return -1; } // if tmin > tmax,ray doesn't intersect AABB if (tmin > tmaX) { return -1; } //HERE TMIN IS 1.#INFOOO return tmin; //THIS IS NEVER REACHED }
以上是大佬教程为你收集整理的c – 返回值1.#INF000全部内容,希望文章能够帮你解决c – 返回值1.#INF000所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。