www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: bigfishcatcher on December 12, 2006, 02:19:58 am

Title: Using Mouse
Post by: bigfishcatcher on December 12, 2006, 02:19:58 am
I was experimenting with FPS example and would like to add mouse movements to it.  Can it be done using only jpct or do you also have to use lwjgl also how do you do it.

Thanks
Nubee
Title: Using Mouse
Post by: manumoi on December 12, 2006, 10:11:35 am
Hello, according to Egon, there is a mouse mapper in the paradroidz source code

http://www.jpct.net/forum/viewtopic.php?t=563&highlight=mousemapper

You should be able to do what you want wuith it.
Title: Using Mouse
Post by: Melssj5 on December 12, 2006, 06:19:42 pm
Yeah, especially if usingOGL render, using the common java MouseListeners is not a god idea, the results are awfull. In fact lwjgl comes with a Mouse class that can be used to do a MouseMapper like Egod did in paradroids.
Title: Using Mouse
Post by: Melssj5 on December 17, 2006, 11:18:26 am
BTW: can I use a MouseMotionListener with OpenGL?

I guess no, but I dont want to create a MouseMapper and I just need the getX and getY methods, not so sophisticated, just to pick an object, nothing else!
Title: Using Mouse
Post by: Melssj5 on December 17, 2006, 11:23:28 am
I declared a Mouse, then just used getDX() and getDY().

Do I need to use the Mouse constructor?
Title: Using Mouse
Post by: Melssj5 on December 17, 2006, 11:28:30 am
I am making lot of spam, but I cant delete my dumb posts.

Anyway to use a Mouse Listener on OGL just declare a Mouse ej:Mouse M;. Mouse is class of lwjgl, then you can acces the Mouse methods like getX () or getDX () to get the movement, and things like that!
Title: Using Mouse
Post by: EgonOlsen on December 17, 2006, 02:12:46 pm
Yeah, Mouse is quite simple to use. The purpose of the MouseMapper was to offer the same functionality for all renderers, but if that isn't needed, Mouse itself is sufficient.