Add support to share the polygons of a Path among PathComponent and PathHitbox
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- game-dev, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- Dart
- Estrellas
- 10.8k
- Forks
- 1.1k
- Merge medio
- 2 d 6 min
- PR fusionados (30 d)
- 56
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flame-engine/flame
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 91/100
flame-engine/flame#4219 ·
Los mantenedores suelen responder en 1 día
-
`UniformsSetter.setColor` sends every color to the shader as blackPosiblemente ocupada @ufrshubham la tomó hace 5 días. Abiertobug
flame-engine/flame#4211 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes sizePosiblemente ocupada @ufrshubham la tomó hace 7 días. Abiertobug
flame-engine/flame#4204 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`Posiblemente ocupada @ufrshubham la tomó hace 7 días. Abiertobug
flame-engine/flame#4203 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resizedPosiblemente ocupada @ufrshubham la tomó hace 7 días. Abiertobug
flame-engine/flame#4202 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de flame-engine/flame
Issues similares
-
SchedulerBinding.requestPerformanceMode(mode) does not forward the requested mode to the engine.Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
carp demo apps enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
carp-dk/carp.sensing-flutter#670 ·
-
[BUG] IP 质量类型误判:ISP 静态段被显示为机房Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
ToUnicode CMap writes code points above U+FFFF as plain hex (5-6 digits), not UTF-16BEPosiblemente ocupada @Rupali59 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días