-
Notifications
You must be signed in to change notification settings - Fork 2
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
[WIP] Start to work on raycast & line #8
base: master
Are you sure you want to change the base?
Conversation
This pull request introduces 2 alerts and fixes 1 when merging a5352a9 into c343554 - view on LGTM.com new alerts:
fixed alerts:
|
const diffX = h * 0.5 - (source.x - Math.round(source.x)) | ||
for (let i = 0; i < max; i++) { | ||
const x = diffX + i * h | ||
const y = x * Math.tan((angle * Math.PI) / 180) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this Math.tan value is always the same, can be put outside of the for loop
const diffY = v * 0.5 - (source.y - Math.round(source.y)) | ||
for (let j = 0; j < max; j++) { | ||
const y = diffY + j * v | ||
const x = y / Math.tan((angle * Math.PI) / 180) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
Description
Work on selection and colision
Issue
Screenshot