Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (769) Games in Android Showcase (230) games submitted by our members Games in WIP (855) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 JOML - quatf.addScaledVector(vec3, float)  (Read 2696 times) 0 Members and 1 Guest are viewing this topic.
KudoDEV

JGO Ninja

Medals: 79
Exp: 6 years

Game Dev Hobbyist

 « Posted 2016-08-22 13:38:25 »

Hello all. It's been awhile.

I started using JOML and finally decided to start the dreaded task converting my physics engine to use JOML.
Right now I'm looking for the JOML equivalent of quatf.addScaledVector(vec3, float), but I cannot find it. Is it just not there?

Also, what does the 'fma' in vec3.fma(float, vec3) stand for? It took me forever to find the function when I needed it!

SHC
 « Reply #1 - Posted 2016-08-22 13:43:36 »

FMA stands for Fused Multiply Add if I remember this right. I have never used it myself, but think I read this somewhere. Correct me if I'm wrong.

Assuming quatf to be a quaternion in floats, how will you add a vector to it? I think quaternions are only used for rotations and not translations or scalings.

KudoDEV

JGO Ninja

Medals: 79
Exp: 6 years

Game Dev Hobbyist

 « Reply #2 - Posted 2016-08-24 20:12:03 »

Assuming quatf to be a quaternion in floats, how will you add a vector to it? I think quaternions are only used for rotations and not translations or scalings.

Typically in physics engines you have a vec3 for angular velocity. This gets scaled by the step delta and added to the rotation quatf.

theagentd
 « Reply #3 - Posted 2016-08-25 22:44:46 »

What you're looking for is an FMA which also converts your vector from Euler angles to a quaternion and then rotates the quaternion in the direction of that quaternion based on the value you pass in...? Doesn't sound that difficult to work around.

Myomyomyo.
KudoDEV

JGO Ninja

Medals: 79
Exp: 6 years

Game Dev Hobbyist

 « Reply #4 - Posted 2016-08-26 00:12:10 »

What you're looking for is an FMA which also converts your vector from Euler angles to a quaternion and then rotates the quaternion in the direction of that quaternion based on the value you pass in...? Doesn't sound that difficult to work around.

Well working around is easy. I was just wondering if it's already in JOML and I missed it.

KaiHH

JGO Kernel

Medals: 622

 « Reply #5 - Posted 2016-09-02 14:05:22 »

Have a look at: Quaternionf.integrate()
Also see GitHub issue #57.
It should be exactly what you were looking for.
Pages: [1]
 ignore  |  Print

 EgonOlsen (1597 views) 2018-06-10 19:43:48 EgonOlsen (1699 views) 2018-06-10 19:43:44 EgonOlsen (1153 views) 2018-06-10 19:43:20 DesertCoockie (1581 views) 2018-05-13 18:23:11 nelsongames (1181 views) 2018-04-24 18:15:36 nelsongames (1704 views) 2018-04-24 18:14:32 ivj94 (2471 views) 2018-03-24 14:47:39 ivj94 (1686 views) 2018-03-24 14:46:31 ivj94 (2770 views) 2018-03-24 14:43:53 Solater (909 views) 2018-03-17 05:04:08
 Deployment and Packagingby mudlee2018-08-22 18:09:50Java Gaming Resourcesby gouessej2018-08-22 08:19:41Deployment and Packagingby gouessej2018-08-22 08:04:08Deployment and Packagingby gouessej2018-08-22 08:03:45Deployment and Packagingby philfrei2018-08-20 02:33:38Deployment and Packagingby philfrei2018-08-20 02:29:55Deployment and Packagingby philfrei2018-08-19 23:56:20Deployment and Packagingby philfrei2018-08-19 23:54:46
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org