Skip to main content
gamedev.net
🔒 Locked

DirectInput Axis Range

Started by Cygon 0 replies 1k views
Original Post
Cygon
Cygon
To get the minimal and maximal values an axis can take, you enumerate all axis objects of a DirectInputDevice and retrieve each one''s range by calling IDirectInputDevice8::GetProperty(DIPROP_RANGE, &dipr); I''m currently using code similar to this to shorten each axis'' value into a range from -1.0 to +1.0 m_fValue = dijoystate.lRx / (dipr.lMax - dipr.lMin); m_fValue *= 2.0f; but I am not sure if it is ok to assume the center position of an axis is in the middle between dipr.lMin and dipr.lMax ? Are there any devices with non-symmetrical axes ? I could image a throttle just going from 0 to 1000 or something, whereas my method would return values between 0.0 and 2.0. If so, how can I find out if this is a one-direction or a two-direction axis ? -Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.