Closed AlexandrosGounis closed 3 years ago
Solved?
I wouldn't consider this an issue anymore, there is a workaround. For instance, one may subscribe to api.position
and get the position from there. I tend to use regular requestAnimationFrame
rather than useFrame
as I have more control over it.
the objects are driven by matrix (matrixAutoUpdate=false) so pos/rot/scale are stale. this is faster. you can extract the position either from the matrix or use getworldpos, both shouldn't be an overhead. or by subscription ofc. i don't think you need to use the more expensive getworldpos, but you can use vec.setFromMatrixPosition(ref.current.matrixWorld ) directly.
Thank you for your replies.
Commit cd7427705506fea3bb700e4a748dbee8271e67af changed
matrixAutoUpdate
. Consider a scenario like this:In order to get the position now, I have to call
ref.current.getWorldPosition()
which appears to be more expensive and because this is inside a frameLoop it might affect performance.What is the proper way to handle this? Can I force
ref
to always update the position?