-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Goal: decide how mathbox-react should mediate interactions with mathBox/Threestrap options.
My understanding of mathBox/Threestrap options.
The options passed to const mathbox = mathBox(options) are passd directly to Threestrap, so really this is a discussion of mathbox-react's API for interacting with Threestrap options.
The Threestrap options are generally of the form { plugins: string[], ...pluginOptions }. In general, plugins have options and an API with methods and properties. For example, the loop plugin has:
-
options:
{ start: boolean, // whether to start the render loop on initialization each: number // render every nth frame }` -
API
{ // methods: stop(): void, // stop the render loop start: void, // stop the render loop get(): void // get current options set(options): // set new options // properties: each: number // render every nth frame }`
Observations:
-
Some options only affect initialization behavvior: For the Loop plugin, updating the
startoption doesn't really make sense because the start option is specifically "start the loop on initialization". It only affects the initialization behavior. Several other plugins have initialization options like this. In contrast, updating theeachoption DOES make sense. -
Some options don't actually work: In particular, the "each" option on Loop does not actually work at the moment. (And in an alternate timeline it was renamed "rate").
-
Some options work, but can't be updated: I'm not 100% sure about this, but I suspect that there are some options (Camera may be one) that function correctly at initialization (e.g., perspective vs orthographic) but then can't be updated without re-initialization.
(I'm not sure that mathbox wroks with orthographic cameras anyway, I would really like it to!)
Questions
- Should
mathbox-reactdo full re-render when options are updated? - Should
mathbox-reactprovide a declartive interface for interacting with the Threestrap plugin "APIs"? For example, should there be a declarative way to start/stop the render loop?
See also discussion in #20