Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JOML - quatf.addScaledVector(vec3, float)  (Read 1927 times)
0 Members and 1 Guest are viewing this topic.
Offline 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!

Offline 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.

Offline 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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 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.
Offline 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.

Offline KaiHH

JGO Kernel


Medals: 482



« 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  
 
 

 
xxMrPHDxx (21 views)
2017-11-21 16:21:00

xxMrPHDxx (14 views)
2017-11-21 16:14:31

xxMrPHDxx (16 views)
2017-11-21 16:10:57

Ecumene (114 views)
2017-09-30 02:57:34

theagentd (150 views)
2017-09-26 18:23:31

cybrmynd (260 views)
2017-08-02 12:28:51

cybrmynd (250 views)
2017-08-02 12:19:43

cybrmynd (247 views)
2017-08-02 12:18:09

Sralse (260 views)
2017-07-25 17:13:48

Archive (881 views)
2017-04-27 17:45:51
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!