I want to use mouse to control my camera position. The idea is to have a global variable float3 pos
that carry the current camera position so that the next update will be from the pos
itself.
When I declare a global variable
in Metal
:
float3 pos;
and get this error:
Global variable must have a constant address space qualifier.
But if I add constant
, it become read only thus I cannot update my current position.
An alternative I can think of is using struct
. But that seems a bit over do.
What is the best way to do this?