Esempio n. 1
0
 /// <summary>
 /// 求发射光线
 /// </summary>
 /// <param name="inDirection">入射光线</param>
 /// <param name="inNormal">法线</param>
 /// <returns></returns>
 public static Double3 Reflect(Double3 inDirection, Double3 inNormal)
 {
     return(inDirection - Double3.Project(inDirection, inNormal) * 2);
 }
Esempio n. 2
0
 /// <summary>
 /// 求向量vector 在平面上的投影
 /// </summary>
 /// <param name="vector"></param>
 /// <param name="planeNormal">平面法向量</param>
 /// <returns></returns>
 public static Double3 ProjectOnPlane(Double3 vector, Double3 planeNormal)
 {
     return(vector - Double3.Project(vector, planeNormal));
 }