Hello. Which of these yields the best performance? And what is the difference among them? Or is it better to just set the camera as the parent to my gunMesh?
I donāt think you need to update the position in the rendering loop or any of these hooks of the rendering loop.
You only need to set the position and rotation once. Then both camera and gun refer to the same instance of the position and rotation. When you update the camera pos and rot, the gun pos and rot would also be updated.
How would I do that? The camera and the gun and the player are three separate meshes. Can I merge them together and then unmerge them? Aka player drops the gun mesh to pick up a new gun etc.
Is it FPS kind scenario? So your camera, player model, and gun are moving together.
When the human player gives inputs like move or rotate, you update all positions of camera, gun and player model together. They should have initial relative position to each other. Then you can do something like this for example:
Yeah itās an FPS. And yeah that makes sense. What about mouse movement and rotation? Iām assuming I would have to have an event listener for āon mouse moveā type of event and then update the rotation values or something like that
may be just not āallā and then,āall at onceā if possible, in an FPS. Rather just the ones needed at t, and in order, please;) A simple beg from an FPS addict;)