Add support to share the polygons of a Path among PathComponent and PathHitbox
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- game-dev, performance
Hướng nghiên cứu
PR #4216 already contains the proposed implementation, tests, and documentation for PathComponent and PathHitbox. Review that pull request and its tests to understand the change; the issue is complete when the PR is merged or its implementation is otherwise incorporated.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem to solve
PathComponent and PathHitbox sample their Path into polygons in their constructor, with
toPolygons, and that sampling is most of what creating one costs. When a game creates many of
them for the same path, like the hitboxes of e.g. enemies spawned over and over, it samples the
same path again for each one: there is no way to reuse polygons already computed, since the
constructor always samples.
Proposal
Add an optional polygons argument to the PathComponent constructor, passed on by PathHitbox.
When it is given, the path is not sampled:
- The polygons are in the coordinates of the given
path, aspath.toPolygons()returns them, or
they are thepolygonsof another component, given along with itspath. - They are copied and moved along with the path, so they can be shared safely.
sampling,toleranceandfilterare not used; they go totoPolygonsinstead.
final polygons = outline.toPolygons(sampling: 2);
final hitboxes = [
for (var i = 0; i < 10; i++) PathHitbox(path: outline, polygons: polygons),
];
A named constructor is not an option, since Dart doesn't allow a non-redirecting generative
constructor next to a primary one (non_redirecting_generative_constructor_with_primary).
More information
I have opened PR #4216 with the proposed implementation, along with tests and the documentation of
PathComponent and PathHitbox.
Other
- Are you interested in working on a PR for this?
- Ngôn ngữ chính
- Dart
- Star
- 10.8k
- Fork
- 1.1k
- Merge trung bình
- 2 ngày 6 phút
- Pull request đã merge (30 ngày)
- 56
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flame-engine/flame
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 91/100
flame-engine/flame#4219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`UniformsSetter.setColor` sends every color to the shader as blackCó thể đã có người làm @ufrshubham đã nhận 5 ngày trước. Đang mởbug
flame-engine/flame#4211 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes sizeCó thể đã có người làm @ufrshubham đã nhận 8 ngày trước. Đang mởbug
flame-engine/flame#4204 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`Có thể đã có người làm @ufrshubham đã nhận 8 ngày trước. Đang mởbug
flame-engine/flame#4203 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resizedCó thể đã có người làm @ufrshubham đã nhận 8 ngày trước. Đang mởbug
flame-engine/flame#4202 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flame-engine/flame
Issue tương tự
-
area: mobile chore good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CommandLineCoding/Elephant#247 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
livekit/client-sdk-flutter#1281 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
android bug priority: P1 qa
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GHRik/bielik_oneclick_launcher#55 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SchedulerBinding.requestPerformanceMode(mode) does not forward the requested mode to the engine.Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
carp demo apps enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
carp-dk/carp.sensing-flutter#670 ·