Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: axis help (Using Ogre3d)  (Read 582 times)

chornox

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
axis help (Using Ogre3d)
« on: October 17, 2009, 05:58:27 PM »

I was able to use the buttons in the joystick but i have no idea how to use the axis
This part works
Code: [Select]
if (mj.buttonDown(0))
{
// Move camera RIGHT
mTranslateVector.x = mMoveScale;
}

However here I have no idea how to use the abs
Code: [Select]
if (mj.mAxes[0].abs==0)
{
// Move camera RIGHT
mTranslateVector.x = mMoveScale;
}

Can you point me to the right direction

Thanks
Logged

chornox

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
Re: axis help (Using Ogre3d)
« Reply #1 on: October 17, 2009, 06:08:20 PM »

Also what is the difference between slider, pov and Axis.

I a new to joysticks so any help would be greatly appreciated
 
Thanks
Logged

chornox

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
Re: axis help (Using Ogre3d)
« Reply #2 on: October 17, 2009, 06:53:46 PM »

I figure out how to use the axis

But I am getting as default the value -256 (when nothing is pressed)
Is this value normal ?

How to set it to 0?
I am using windows, is it same under Linux ?

Thanks
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: axis help (Using Ogre3d)
« Reply #3 on: October 17, 2009, 06:58:35 PM »

Some joysticks randomly fluctuate. Depends on the Joy. You should see values -32k to +32k. Anything near the 0's or extremes is bound to be inaccurate.

POV's are more like arrow keys/buttons. POV/Hat/Direction pad (D-Pad) are all the same thing.
Logged

chornox

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
Re: axis help (Using Ogre3d)
« Reply #4 on: October 17, 2009, 07:20:52 PM »

So the value -256 is just how the joy is setup.

by "-32k to +32k" you mean values close to -32k and 32k or you meant from [-32k, 32k]

Thanks for your help
Logged