`Transform::combine` is not robust.
Opened this issue · 0 comments
Des-Nerger commented
Not any two Transform
s can be combined into one.
For instance, you can't combine these two:
Tranform(vec3(0, 0, 0), angleAxis(45.0f * QUAT_DEG2RAD, vec3(0, 0, 1)), vec3(1, 1, 1))
Tranform(vec3(0, 0, 0), quat(), vec3(1, 0.5, 1))
To illustrate, here's an example of applying these two Transform
s to an axis-aligned square with the origin in the center:
So Transform::combine
doesn't give the expected result in this case.
Possible solutions:
- Either narrow the definition of
Transform
to prohibit non-uniform scales:
struct Transform {
vec3 position;
quat rotation;
float scale;
- Or the opposite: widen the definition:
struct Transform {
vec3 position;
mat3 linear;
- Or give up the idea of implementing
Transform::combine
at all.