This adds a Random utility class that provides more functionality than the existing rnd() function used in the multithreaded example.
It does some minor cleanup on the animation logic.
glm::vec3 rotation replaced by float rotationAxis; because the X and Z values are never read or written.
glm::mat4 model removed as it's only used as an intermediate value to write to the push constant structure
The push constant structure is absorbed by ObjectData because there's no reason for separate storage, they're always 1:1
Logic to initialize ObjectData, update it per-frame and extract the mat4 are moved into the structure itself, reducing the verbosity and amount of indirection required to access all the variables
Where possible convert values to radians at initialization time rather than each update
In a couple places where the logic was something like x = a + rnd(b) I've updated it to be random.real(a, a+b) which provides the same range of values but feels easier to read
This adds a
Random
utility class that provides more functionality than the existingrnd()
function used in the multithreaded example.It does some minor cleanup on the animation logic.
glm::vec3 rotation
replaced byfloat rotationAxis;
because the X and Z values are never read or written.glm::mat4 model
removed as it's only used as an intermediate value to write to the push constant structureObjectData
, update it per-frame and extract the mat4 are moved into the structure itself, reducing the verbosity and amount of indirection required to access all the variablesx = a + rnd(b)
I've updated it to berandom.real(a, a+b)
which provides the same range of values but feels easier to read