Skip to content
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

Make attractors regular modifiers #286

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Make attractors regular modifiers #286

merged 2 commits into from
Feb 26, 2024

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented Feb 26, 2024

Remove the built-in code and shader handling a fixed-size array of force field attractors/repulsors, and related types ForceFieldSource and ForceFieldModifier. Replace them with a new ConformToSphereModifier describing a single attractor/repulsor source, which can be repeated to add more sources. The new modifier is a regular update context modifier without any specific built-in codepath, making its handling a lot easier and cleaner, while also allowing any custom attraction force expression as well as customizing other parameters of the source in real time.

Revamp the force_field.rs example to showcase this new modifier, and add a dedicated parameter tweaking panel to observe the effect of each parameter.

Fix a panic in rendering code when no effect is present. This looks like a race condition; for now simply early out to prevent the panic.

effects_meta.dr_indirect_bind_group.as_ref().unwrap()

Remove the built-in code and shader handling a fixed-size array of force
field attractors/repulsors, and related types `ForceFieldSource` and
`ForceFieldModifier`. Replace them with a new `ConformToSphereModifier`
describing a single attractor/repulsor source, which can be repeated to
add more sources. The new modifier is a regular update context modifier
without any specific built-in codepath, making its handling a lot easier
and cleaner, while also allowing any custom attraction force expression
as well as customizing other parameters of the source in real time.

Revamp the `force_field.rs` example to showcase this new modifier, and
add a dedicated parameter tweaking panel to observe the effect of each
parameter.

Fix a panic in rendering code when no effect is present. This looks like
a race condition; for now simply early out to prevent the panic.

```rust
effects_meta.dr_indirect_bind_group.as_ref().unwrap()
```
@djeedai djeedai added A - internal Internal change on a core system A - examples Change related to examples A - modifiers Change related to modifiers C - breaking change A breaking API or behavior change labels Feb 26, 2024
@djeedai djeedai merged commit fe3680b into main Feb 26, 2024
16 of 17 checks passed
@djeedai djeedai deleted the u/mod-conform-sphere branch February 26, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - examples Change related to examples A - internal Internal change on a core system A - modifiers Change related to modifiers C - breaking change A breaking API or behavior change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant