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

Scalar multiplication for quaternions #316

Closed
kebiro opened this issue Aug 9, 2022 · 1 comment
Closed

Scalar multiplication for quaternions #316

kebiro opened this issue Aug 9, 2022 · 1 comment

Comments

@kebiro
Copy link

kebiro commented Aug 9, 2022

Hi,

first of all, thanks for this library. I've really enjoyed working with it so far.

I've noticed that there is no scalar multiplication method for quaternions. It's trivial to implement (see Real-Time Rendering 4th Edition p. 77) so imo it should be provided (either as a mul overload or its own method), unless there is a specific reason for its absence.

For now I'm making do with an extension function:

fun Quaternionf.scalarMul(s: Float): Quaternionf {
    this.x *= s
    this.y *= s
    this.z *= s
    this.w *= s
    return this
}
httpdigest added a commit that referenced this issue Aug 10, 2022
@httpdigest httpdigest added this to the 1.10.5 release milestone Aug 10, 2022
@httpdigest
Copy link
Member

Thanks for the suggestion! The method mul() has been added to the quaternion classes and published with the latest 1.10.5-SNAPSHOT.

@kebiro kebiro closed this as completed Aug 10, 2022
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

2 participants