UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

15 lines 727 B
/** * Computations of screen-space pixel area covered by a sphere * NOTE: Port of GLSL code by Ingo Quilez. Source: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm * @param {number[]|{0:number,1:number,2:number,3:number}} sph Sphere in world space * @param {number[]|Float32Array} cam camera transform matrix (world to camera)(inverse world matrix of camera) * @param {number} fl focal length (fov in Radians) * @returns {number} area on the screen as a fraction, 1=entire screen, 0=zero area */ export function sphere_project(sph: number[] | { 0: number; 1: number; 2: number; 3: number; }, cam: number[] | Float32Array, fl: number): number; //# sourceMappingURL=sphere_project.d.ts.map