How to change the view via joystick

12 Feb 2018 15:51 #37735 by sanni
Hi guys,

I'm looking for a (nasal) function to change the view.
That's what I want:
When you press a joystick button the goes to left or right 90°. When you release this button it goes back to normal view or ev. to the previous angles of view.

That means a need a function to change an angle directly and another one to get the actual angles. I think there is a nasal function to realize something like that?!

Sanni

FG 2017

Please Log in or Create an account to join the conversation.

12 Feb 2018 15:59 #37736 by Algernon
It's actually doable from the joystick configuration files - it's probably already a Nasal function actually, as it's a common requirement. The main thing we need to know is, what your hardware is, and what sort of buttons you're talking about. Most people use a "hat" for views, and if you want to do that, we need to ascertain a few details - some hats are seen as an axis (or two axes actually), others as four buttons.

Please Log in or Create an account to join the conversation.

12 Feb 2018 16:01 #37737 by Algernon
Oh, another thing - we could use this thread to demonstrate using some basic nasal to add a bit more 'flair', for example your view could move quickly round rather than jumping to the left if you preferred, to simulate the act of actually moving your head

Please Log in or Create an account to join the conversation.

12 Feb 2018 17:30 #37738 by timi
I needed this function once to do really large screenshots by combining them out of smaller ones.
So I needed to move the view by an angle of my own choosing like 15 or 30 degrees. Seems I have several ways of doing that in my joystick config right now. I'm attaching the file here.

File Attachment:

File Name: Joystick--....xml.txt
File Size:4 KB
Attachments:

Please Log in or Create an account to join the conversation.

12 Feb 2018 18:11 #37739 by sanni
Ah, I see you manipulate the property tree directly.
Thought there is a function like get/setHeadigDeg() or anything like that.

But thanks, that is what I need! :)

FG 2017

Please Log in or Create an account to join the conversation.

12 Feb 2018 18:58 - 12 Feb 2018 18:59 #37740 by Algernon
We'll see. That approach may not work for all hardware. I'd suggest it's better practice to utilise FlightGear's built in view functions rather than go straight to the property tree.

Please Log in or Create an account to join the conversation.

12 Feb 2018 19:14 #37741 by timi
There was some property that wouldn't change the view when the simulation was paused. Don't remember what it was but that's also one issue should you wish to change the view when paused.

Please Log in or Create an account to join the conversation.

Time to create page: 0.096 seconds
Powered by Kunena Forum

PM Mailbox

You are not logged in.

Forum Search

Keyword