JOML FreeCamera example

Started by MickeyB, February 16, 2016, 16:22:37

Previous topic - Next topic

MickeyB

Update: of course, shortly after posting this, I got my camera to work.  LOL   Would still be interested in the answer, though.

There are a number of methods that expect a Vector3f returned, but the Quaternionf does not have any methods that return that type, so each of those methods is a compile error.  Am I missing something? 

Trying to use this as my camera implementation for a "lookAt" does not want to be anything but a lookthru.
M

Kai

Huh?...  ???

Trying to come up with an answer to your post... How should I phrase this. Let me try it this way:
I have some good news and some bad news for you.
Good news first: After having spent developing with JOML for the last year I think I know my around it and could probably help you.
Now the bad news: After reading your post there are so many question marks popping up in my brain that I actually might not be able to help. :)

Which "number of methods that expect a Vector3f" do you mean? Methods taking Vector3f as parameters? Where are those methods? And what do their JavaDocs say they should be good for?
You seem to only relate Quaternionf to Vector3f syntactically/Java-typewise but not semantically.

And why are those methods compile errors? You mean method invocations result in compile-time errors when you want to apply some "method that expects a Vector3f" to an argument of type Quaternionf? Sure, that is just how Java types work. Vector3f != Quaternionf. :)

There is a demo showcasing that camera class. You should have a look at it.

MickeyB

Apologies for vagueness...

I have pulled down your demos, which is where I found the FreeCamera class.

From the code:
public Vector3f right(Vector3f dest) {
        return rotation.positiveX(dest);
    	
    }


where rotation is a Quaternionf.  there are no methods of the Quaternionf that return a Vector3f.   At least according to the eclipse helpers/intellisense.
M

Kai

Are you sure that you are using a modestly recent version of JOML?
Everything after about 7th of August 2015 (release 1.5.0) will do, where all methods in all classes have been changed to always return the method argument whose members are modified by the method.
Did you import the demo project as a Maven project and let it download the referenced version of JOML from Central/Sonatype?

EDIT: And can you please very precisely explain where you are having compile-time errors? What exact file and what exact line number and what exact error message.

EDIT2:
To make sure you get the right dependency, do the following:
- either in Eclipse, rightclick the project -> "Maven" -> "Update Project..." -> Mark "Force Update of Snapshots/Releases" and hit "OK"
- or on the command line: "mvn -U clean package"

MickeyB

As stated, the FreeCamera class and the line I showed was a cut and paste from that class.  Anyway, it appears I have JOML 1.4.0 for some reason, so will update now.
M

Kai

QuoteThanks for pointing out that the version of JOML was possibly wrong.
You are very welcome!

@Spasi: Could you please move to the JOML subforum? Thanks!

MickeyB

Maven updated me to 1.6.8, yet the Qauternionf still does not show a positive method to return a Vector.   I see it in the online docs but the javadocs jar with 1.6.8 does not show that method being available.  Can I have a jar in cache, maybe?  Just very strange, never had this much trouble with a 3rd party jar so it must be something I am doing wrong.
M

Kai

JOML 1.7.0 has been properly deployed to Maven Central.
Version 1.7.1-SNAPSHOT has been properly deployed to oss.sonatype.org.
The latest 1.0.0-SNAPSHOT of joml-camera has been properly deployed to oss.sonatype.org with its pom referencing JOML 1.7.1-SNAPSHOT as compiletime dependency and having a reference to oss.sonatype.org's snapshot repository to fetch 1.7.1-SNAPSHOT of JOML.
So I don't know what your issue is. Maybe you have a Maven mirror/proxy?
Or you disallow downloading of snapshot-versioned dependencies?
Also please note that there has never been a real non-shapshot release of joml-camera, since it is just experimental and unsupported still.

MickeyB

ok, refreshed a few times and got 1.7.0 and now errors are gone.  thanks again.
M