4 hours ago, cozzie said:
My question is about the transform. Would you store a position, rotation and scale? Or just a 4x4 matrix (I think assimp provides the latter).
What format do you need the data to be in later? Are you going to send 4x4 matrices to a shader later? If yes, do you want to just copy the data directly into a constant buffer? If yes, then sure, that sounds great!
Are you going to send positions/rotations/scales into some kind of skeleton class that operates on that data? If yes, then sure, that sounds great!
Figure out where the data is flowing to and it will tell you how it should be formatted. Work backwards, start with the consumers of the data, then design the producers to fit.
Also, lots of engines restrict scaling to uniform / one-dimensional, while others support non-uniform / three-dimensional scaling. If you decide to allow the latter, that impacts how you write your shaders (normals cannot be transformed by your regular matrices -- you also need to pass the inverse-transpose of your matrices to your shaders). There's nothing wrong with limiting the kind of data that's permitted to be imported, and it's probably good to do some sanity checks over the input data and make some noisy errors if artists try to create content that your engine can't handle.
1 hour ago, haegarr said:
For static transforms it also may make sense to think about baking the transform into the geometry, so not using child transforms at all.
FWIW in my engine, I use a naming convention on the nodes in our DCC tool. If the artists create a node that begins with "M_", then I flag is as dynamic / important at runtime. If their nodes don't begin with that prefix, then I flag it as static / not required at runtime. Static nodes are collapsed into their parents, and their transforms are applied directly to the vertex data (a.k.a. baking). Dynamic nodes write out two 4x4 matrices -- an absolute node-to-world matrix (which can be copied directly into a constant buffer and used for rendering), and a relative node-to-parent matrix (which can be copied into my skeletal animation / ragdoll system).