0

观看此图像示例:

看例子 大家好,我有一个关于“交叉点”的问题,我想要的是当我点击屏幕时,我得到交叉点,然后我根据交叉点在地面上放置一个 3d 模态。问题是我无法到达十字路口。

这是我的代码

public Vector3 getIntersect(int screenX, int screenY) {
    Ray ray = cam.getPickRay(screenX, screenY);
    Vector3 ins = new Vector3();
    for (int i = 0; i < parentModels.size; ++i) {
        final GameObject go = parentModels.get(i);
        Intersector.intersectRayBounds(ray, go.bounds, ins);
    }
    return ins;
}

GameObject 从 ModelInstance 扩展而来。

4

0 回答 0