提交 201c92a8 编写于 作者: M Mr.doob

Ray.intersectObject now also sorts. Fixes #1837.

上级 5e2df8e0
......@@ -26,6 +26,12 @@ THREE.Ray = function ( origin, direction ) {
var vector = new THREE.Vector3();
var normal = new THREE.Vector3();
var intersectPoint = new THREE.Vector3()
var descSort = function ( a, b ) {
return a.distance - b.distance;
};
this.intersectObject = function ( object ) {
......@@ -157,6 +163,8 @@ THREE.Ray = function ( origin, direction ) {
}
intersects.sort( descSort );
return intersects;
}
......@@ -171,7 +179,7 @@ THREE.Ray = function ( origin, direction ) {
}
intersects.sort( function ( a, b ) { return a.distance - b.distance; } );
intersects.sort( descSort );
return intersects;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册