Box2.intersectsBox(box)
是一个three.js中的Box2对象方法,用于判断当前Box2对象与另一个Box2对象是否相交。
Box2.intersectsBox( box: Box2 ): Boolean
box
- 另一个Box2对象。true
。false
。const box1 = new THREE.Box2(new THREE.Vector2(0, 0), new THREE.Vector2(1, 1));
const box2 = new THREE.Box2(new THREE.Vector2(0.5,0.5), new THREE.Vector2(2, 2));
const result = box1.intersectsBox(box2);
console.log(result); // 输出 true