private isAllowMove (pos: THREE.Vector3) {
let flag = true;
let position = pos.clone();
let tempV = position.applyMatrix4(this.camera.matrixWorldInverse).applyMatrix4(this.camera.projectionMatrix);
if ((Math.abs(tempV.x) > 1) || (Math.abs(tempV.y) > 1) || (Math.abs(tempV.z) > 1)) {
flag = false;
}
return flag;
}
Threejs 通过摄像机检测物体是否超过屏幕边界
最新推荐文章于 2023-08-31 13:24:52 发布