Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform::combine is not robust. #5

Open
Des-Nerger opened this issue Nov 26, 2023 · 0 comments
Open

Transform::combine is not robust. #5

Des-Nerger opened this issue Nov 26, 2023 · 0 comments

Comments

@Des-Nerger
Copy link

Des-Nerger commented Nov 26, 2023

Not any two Transforms 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 Transforms to an axis-aligned square with the origin in the center: videogame_isometry
So Transform::combine doesn't give the expected result in this case.

Possible solutions:

  1. Either narrow the definition of Transform to prohibit non-uniform scales:
struct Transform {
	vec3 position;
	quat rotation;
	float scale;
  1. Or the opposite: widen the definition:
struct Transform {
	vec3 position;
	mat3 linear;
  1. Or give up the idea of implementing Transform::combine at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant