I'm working on an audionimbus integration for Godot's Rust Bindings, gdext.
This is how my Simulator is configured on the editor side:
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
I'm working on an
audionimbusintegration for Godot's Rust Bindings,gdext.This is how my
Simulatoris configured on the editor side:In case you're not familiar with Godot, the reflection settings are not hardcoded to
Convolution, but allow a selection dropdown to other variants likeParametric. Unfortunately, making this work with the code side is pretty hard, sinceSimulatorhas a generic param for theREreflection effect. That means that my runtime struct that keeps ownership of theSimulatorneeds to either hardcode theSimulatoror keep something likeI right now work around this in an extremely cursed way: I store the simulator with
Convolutionas itsREgeneric, but pass itSimulationSettingscontaining other variants withlet 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
RayTracerand also affectsScene