![]() ![]() Each of this properties should include its axis final position (from -1 to 1) taking into account all the modifiers (deadzone, saturation, sensitivity, etc.). The calculated X and Y positions of the axes are retrieved by ComputedX and ComputedY properties. My Distance property is working well, but when I apply the sensitivity, the retrieved distance is less than 1 on diagonal directions if I move my josytick around, when it should be exactly 1, no matter the direction.īelow, I'm including a simplified version of my Joystick class, where I removed most of the unrelevant code. ![]() My Joystick class has a Distance property, which retrieves the stick's distance from center (a value from 0 to 1). It seems to be working when the joystick direction is either horizontal or vertical, but when I move it to a diagonal direction, is seems buged. Right now, I already have my temporary fix which is not working very well. I want to apply circular sensitivity to the stick, but I don't really know how to do that, specially taking into account other calculations on the axes (like deadzone, distance from center, etc.). I applied sensitivity on a X-Box trigger without problems, but because a joystick has two axis (X and Y), I'm having trouble with the math involved. Sensitivity should make the joystick's distance from center non-linear. I'm having trouble with the mathematics of it, specifically with the sensitivity part. I'm working on a class that represents a stick of a gamepad. How to calculate joystick sensitivity, taking into account deadzone and the circular nature of the stick? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |