Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] 3D FPS vs Macbook Air trackpad (or even a mouse)

Author
Message
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 28th Aug 2019 04:31 Edited at: 28th Aug 2019 04:33
Hello,

I'm programing on a 3D retro levels player open library.
It works on Windows and Ubuntu.
But i have a problem on Macbook Air trackpad.
Same thing if i connect a mouse.

The problem is with these commands : SetRawMousePosition() / GetRawMouseX() / GetRawMouseY().

I use SetRawMousePosition(GetVirtualWidth() / 2.0, GetVirtualHeight() / 2.0) to reposition the mouse at center.
And when the player move the mouse to look around, i substract it from GetRawMouseX() / GetRawMouseY(), to get MouseMoves.
Sadly, after a needed simple click on mac screen, the player mouse moves has no effect.

Have you any working piece of code to solve my problem ?
(The 3D FPS Example, with the click needed anytime is not what i need)

I've attached my program, at this time.
Emotional High Potential

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2019 04:34
SetRawMousePosition( x, y )

from the help file
Description
Attempts to position any mouse pointer used on this platform. Not guaranteed to work on all platforms. Will only work whilst your app window has focus.

fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2019 04:54
all of the raw commands are machine and OS specific and should only be used if you can guarantee them to work
on your target audience device otherwise you should use these commands to ensure compatability
https://www.appgamekit.com/documentation/Reference/Input.htm

fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 28th Aug 2019 05:49
Ok. But is there a solution found by someone, to make a simple FPS player ? A simple source code ?
Emotional High Potential
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2019 06:15 Edited at: 28th Aug 2019 06:17
Theres isn't a way of setting the mouses position but there is the following
GetPointerX()
GetPointerY()

which should work fine with your airpad
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 28th Aug 2019 08:06 Edited at: 28th Aug 2019 08:25
The way is far from GetPointerX() / GetPointerY() to a working 3D FPS camera.
Any help ?

( Or i will rename you TJC (the jokes creators) )

May be is it difficult to say the truth : you can't use GetPointerX() / GetPointerY() to make a real FPS ?
Emotional High Potential
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2019 08:44
Quote: "The problem is with these commands : SetRawMousePosition() / GetRawMouseX() / GetRawMouseY()."


that's what I answered

and if you look at this thread https://forum.thegamecreators.com/thread/222027
in particular the post "A small random 3D world of fractals and Kaleidoscopes"
you will find one of the many solutions across the forums
If you comment out all the SetRawMousePosition() it will work quite well as for your rudeness I wont help with it anymore
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 2nd Sep 2019 04:15
This post has been marked by the post author as the answer.
Do you know the story of a mute, that say to a deaf that a blind spy them ?
Emotional High Potential

Login to post a reply

Server time is: 2024-11-22 17:25:50
Your offset time is: 2024-11-22 17:25:50