各メッシュ ( ) に対して、Three.js は非常にTHREE.Object3D
便利なプロパティを提供boundingSphere
しboundingSphere
ます。intersectsSphere
isIntersectionBox
これで、単純な衝突検出に使用できると思いましたが、試してみると、boundingSphere
boundingSphere.center が常に入っているため、常に衝突が発生しているように見え(0, 0, 0);
ます。 object - オブジェクトのクローンを作成boundingSphere
し、ワールド座標を取得してから使用しますintersectsSphere
。
このようなもの:
var bs = component.object.geometry.boundingSphere.clone();
bs.center.setFromMatrixPosition(component.object.matrixWorld);
...
if (_bs.intersectsSphere(bs)){
これはどのように使用されると思われますか、それとも何かが足りないので、boundingBox/boundingSphere に基づいて衝突検出を行うより便利な方法がありますか?