是否有可能获得两个shape3d的交叉点?
(一个是Line,另一个是QuadArray)
在我尝试使用hack和slash方法之前,只是想知道是否有一种简单的方法?
- 我是Java 3D的新手,所以我可能错过了一个完全符合我需要的功能。
答案 0 :(得分:1)
简单的方法是使用Bounds和intersect方法:
Bounds quadArrayBounds = quadArrayShape.getBounds();
if (quadArrayBounds.intersect(new Point3d(startLine.x, startLine.y, startLine.z),
new Vector3d(endLine.x, endLine.y, endLine.z))){
// Action to do if Intesect is true
}