-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
pick nits from example bounding_2d #12563
pick nits from example bounding_2d #12563
Conversation
fn draw_filled_circle(gizmos: &mut Gizmos, position: Vec2, color: Srgba) { | ||
for r in [1., 2., 3.] { | ||
gizmos.circle_2d(position, r, color); | ||
} | ||
} |
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.
Previously, this logic appeared in two places. I pulled it into a function with a name that explains what it's trying to do.
aabb_cast.ray.ray.origin | ||
+ *aabb_cast.ray.ray.direction * toi | ||
+ aabb_cast.aabb.center(), | ||
aabb_cast.ray.ray.origin + *aabb_cast.ray.ray.direction * toi, |
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.
aabb_cast.aabb.center()
is always Vec2(0.0, 0.0)
, and so adding it here has no effect on the position of the rendered rect_2d
circle_cast.ray.ray.origin | ||
+ *circle_cast.ray.ray.direction * toi | ||
+ circle_cast.circle.center(), | ||
circle_cast.ray.ray.origin + *circle_cast.ray.ray.direction * toi, |
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.
ditto for this circle_2d
Objective
Solution
Vec2(0.0, 0.0)
)