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

Adding Math. to random() #64

Closed
wants to merge 1 commit into from

Conversation

Falling10fruit
Copy link

I got an error in the debug console:

Uncaught TypeError: random is not a function at buildPermutationTable (simplex-noise.js:505:22)

I got an error in the debug console:

Uncaught TypeError: random is not a function
    at buildPermutationTable (simplex-noise.js:505:22)
@jwagner
Copy link
Owner

jwagner commented Jan 22, 2024

Thanks for the PR @Falling10fruit.

As you can see from the test results, it breaks everything though. Random should be the variable random (coming in as an argument) and not math.random. It's likely that the code triggering the error you posted is passing in an invalid random function into simplex-noise If you share the code to reproduce the error I can help you to pin down the issue.

Before opening future PR please run the tests first. I should probably add a contributing file to the Repo to make this more clear.

@Falling10fruit
Copy link
Author

Alright never mind I forgot that I wasn't supposed to directly use the createNoise functions.

And now all it does is return zero, should I make an issue?
Codepen
VSCode

@jwagner
Copy link
Owner

jwagner commented Jan 22, 2024

From the API Docs

Coordinates should be finite, bigger than -2^31 and smaller than 2^31.

If you can avoid it, also don't sample at exact integer coordinates.

@Falling10fruit
Copy link
Author

Alright thanks

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

Successfully merging this pull request may close these issues.

2 participants