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

Exponent calculation for quaternions appears to be missing from LQuaternionf #160

Closed
ghost opened this issue Aug 9, 2017 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Aug 9, 2017

The common concept of exponent calculation for quaternions appears to be missing from panda3d.core.LQuaternionf/panda3d.core.LRotationf.

When interpreting a quaternion as a relative rotation (and not an orientation), you could e.g. want to apply only half or only 30% of a rotation. The computation of this appears to be commonly notated with q as base and e.g. 0.5 or 0.3 as exponent: q ** 0.3 (as described here: https://math.stackexchange.com/questions/162863/how-to-get-a-part-of-a-quaternion-e-g-get-half-of-the-rotation-of-a-quaternion/162892#162892 )

However, on the panda3d API reference page http://www.panda3d.org/reference/devel/python/panda3d.core.LQuaternionf the only function even mentioning exponent returns LVecBase4f and not a Quaternion and seems to be inherited from LVecBase4f instead of doing something quaternion-specific.

Is such a functionality implemented somewhere and I'm just missing it? Otherwise, it would be very useful if this could be added.

@ghost
Copy link
Author

ghost commented Aug 16, 2017

For what it's worth, smooth mover (which I am currently using as a replacement for this calculation) looks like it has gimbal lock limitations. Therefore, having this would be a great addition to do this calculation properly without such limitations.

@rdb rdb closed this as completed in a6f737d Dec 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant