Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mat4.perspectiveFromFieldOfView fov wrong type #199

Closed
LabEG opened this issue Dec 10, 2015 · 1 comment
Closed

mat4.perspectiveFromFieldOfView fov wrong type #199

LabEG opened this issue Dec 10, 2015 · 1 comment

Comments

@LabEG
Copy link

LabEG commented Dec 10, 2015

https://github.com/toji/gl-matrix/blob/master/src/gl-matrix/mat4.js#L1733-L1739

 * @param {mat4} out mat4 frustum matrix will be written into
 * @param {number} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
 * @param {number} near Near bound of the frustum
 * @param {number} far Far bound of the frustum
 * @returns {mat4} out
 */
mat4.perspectiveFromFieldOfView = function (out, fov, near, far) {
    var upTan = Math.tan(fov.upDegrees * Math.PI/180.0),
        downTan = Math.tan(fov.downDegrees * Math.PI/180.0),
        leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0),
        rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0),
        xScale = 2.0 / (leftTan + rightTan),
        yScale = 2.0 / (upTan + downTan);

{number} fov Object containing the following values: upDegrees, downDegrees - number is not object =)

Need make object fov.

Same bug and in gl-matrix.d.ts =(

toji added a commit that referenced this issue Dec 11, 2015
As pointed out in Issue #199, fov is an Object not a number.
@toji
Copy link
Owner

toji commented Dec 11, 2015

Fixed. Thanks for pointing that out.

@toji toji closed this as completed Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants