I have my scene setup in a way that the arcate rotate rotates around the wrong axes and instead of rotate all object I thought maybe it is enough to change upVector.
The renderer doesn’t treat that property different than other Vector3’s. ie: target that you are using
Do you have a repro or can share more of the code? I can try it out when I get home, but what you have ought to work.
edit: actually easy to repro. I’ll try to track the bug tonight
Solutionwise - I think I know the problem - it’s because we don’t call the upVector setter and other code depends directly on the vector being normalized and setMatUp() being called. Almost like Vector3 should publish an event, so we don’t need comments like here (but it’s well documented at least!): BabylonJS/Babylon.js (github.com)
I can see in the TypeScript compiler when the property is a “set accessor” or not. For correctness I can deoptimize that. ie: if Babylon.js doesn’t check if the Vector3 is dirty etc. I think any solution downstream in Babylon.js will have performance impact and add some code clutter. Let’s hold off to see if this is deemed a bug - otherwise I’ll fix upstream that setters are called instead of their nested props.
@sebavan is that a bug or just by design and need to deal with it as-is? Cheers
Thanks for official confirmation. Noted as “won’t fix”. Totally fine as it’s a really small edge case and even well documented in the property.
So setting transformNodeInstance.position.x = 2 vs. position prop changes result of _IsSynchronized.. resulting in essentially what looks like “non-deterministic” behaviour from seemingly identical changes. I think an audit of the library would bring to light many more potential issues. As I mentioned the fix is “easy but tedious”, but the performance and memory are of utmost importance. Definitely interesting to look at the impact of and to revisit design decisions.
hi @Todilo sorry this took so long - the code was committed to repo the day after your original question was asked! anyway - it’s out now on version 3.1.13.