Closed nickmcintyre closed 5 months ago
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
Hey,
I was able to replicate this issue and possibly found a fix.
It seems that in src\core\shape\vertex.js
for the normal()
method the documentation was written as @param {Vector} vector
and since Vector isn't a native JS class when the FES couldn't use instanceOf to check and typeOf checked the e.g. in your example let n = createVector(-0.4, -0.4, 0.8);
which would return object since Vector is not a native JS class.
A quick and easy fix would be to change @param {Vector} vector
to @param {p5.Vector} vector
so FES can correctly check the parameter.
I linked a PR below that would fix this issue. Let me know if there is any issue with it.
Thanks!
Most appropriate sub-area of p5.js?
p5.js version
1.9.2
Web browser and version
Chrome 124.0.6367.60
Operating system
macOS 14.4.1
Steps to reproduce this
Steps:
p5.Vector
object.normal()
.Snippet:
I noticed this while working on the reference. Passing a
p5.Vector
tonormal()
generates the following FES message:See the full sketch.