Skip to content

Configuring a Simulator's reflection effect outside of code is hard #69

Description

@janhohenheim

I'm working on an audionimbus integration for Godot's Rust Bindings, gdext.
This is how my Simulator is configured on the editor side:

Image

In case you're not familiar with Godot, the reflection settings are not hardcoded to Convolution, but allow a selection dropdown to other variants like Parametric. Unfortunately, making this work with the code side is pretty hard, since Simulator has a generic param for the RE reflection effect. That means that my runtime struct that keeps ownership of the Simulator needs to either hardcode the Simulator or keep something like

enum SimulatorKind {
  Convolution(Simulator<..., Convolution>),
  Parametric(Simulator<..., Parametric>),
  ...
}

I right now work around this in an extremely cursed way: I store the simulator with Convolution as its REgeneric, but pass it SimulationSettings containing other variants with let simulation_settings = unsafe { std::mem::transmute::<_, _>(simulation_settings) };

I suspect that is not very robust and may even be UB depending on audionimbus's internals.

NB: something very similar is also true for RayTracer and also affects Scene

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions