Add support to share the polygons of a Path among PathComponent and PathHitbox
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 15/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 領域
- game-dev, performance
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- Dart
- スター
- 10.8k
- フォーク
- 1.1k
- 平均マージ
- 2日 6分
- マージ済み PR(30日)
- 56
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flame-engine/flame のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
flame-engine/flame#4219 ·
メンテナーはふだん 1 日以内に返信
-
`UniformsSetter.setColor` sends every color to the shader as black対応中かも @ufrshubham が 5 日前に担当しました。 オープンbug
flame-engine/flame#4211 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes size対応中かも @ufrshubham が 8 日前に担当しました。 オープンbug
flame-engine/flame#4204 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`対応中かも @ufrshubham が 8 日前に担当しました。 オープンbug
flame-engine/flame#4203 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resized対応中かも @ufrshubham が 8 日前に担当しました。 オープンbug
flame-engine/flame#4202 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
flame-engine/flame の issue をすべて見る
似ている issue
-
SchedulerBinding.requestPerformanceMode(mode) does not forward the requested mode to the engine.オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
carp demo apps enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
carp-dk/carp.sensing-flutter#670 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
ToUnicode CMap writes code points above U+FFFF as plain hex (5-6 digits), not UTF-16BE対応中かも @Rupali59 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 4 日以内に返信