epsilonCoplanarTest是Yuka js库中的一个函数,用于测试两个三维向量是否在误差限度内共面。该函数是基于epsilon值判断误差的方法。
epsilonCoplanarTest( vectorA: Vector3, vectorB: Vector3, epsilon: number ): boolean
如果在epsilon误差限度内vectorA和vectorB共面,则返回true,否则返回false。
import { epsilonCoplanarTest, Vector3 } from 'yuka';
const a = new Vector3( 0.1, 0.2, 0.3 );
const b = new Vector3( 0.3, 0.6, 0.9 );
if ( epsilonCoplanarTest( a, b, 0.01 ) ) {
console.log( 'a and b are coplanar within the tolerance' );
}
else {
console.log( 'a and b are not coplanar within the tolerance' );
}