Function useFiveProject2d

  • Five React Hooks: 将三维的坐标对应到而为屏幕

    Returns ((vector: Vector3, testModel: boolean) => Vector2)

      • (vector, testModel): Vector2
      • Parameters

        • vector: Vector3
        • testModel: boolean

        Returns Vector2

    preject2d

    计算模型射线碰撞检测
    // param vector 三维的坐标
    // param testModel 是否和模型检测,如果检测,则被模型遮挡会返回 null
    // returns 三维的坐标 或者 null
    preject2d(vector: THREE.Vector3, testModel: boolean): THREE.Vector2null
    const preject2d = useFiveProject2d();
    const { x: width, y: height } = preject2d(new THREE.Vector3(0, 0, 0));