comparison include/SDL_haptic.h @ 2500:5251d0510b7e gsoc2008_force_feedback

Implemented polar coordinates in linux. SDL_ConditionEffect now takes into account both axes.
author Edgar Simo <bobbens@gmail.com>
date Sun, 06 Jul 2008 21:47:41 +0000
parents cc2b270608b2
children ff12f79dfc8d
comparison
equal deleted inserted replaced
2499:cc2b270608b2 2500:5251d0510b7e
448 * \struct SDL_HapticCondition 448 * \struct SDL_HapticCondition
449 * 449 *
450 * \brief A structure containing a template for a Condition effect. 450 * \brief A structure containing a template for a Condition effect.
451 * 451 *
452 * Direction is handled by condition internals instead of a direction member. 452 * Direction is handled by condition internals instead of a direction member.
453 * Each of right_sat, lefT-sat, right_coeff, left_coeff, deadband and center
454 * have two parameters, first is for x value, second is for y value following
455 * the scheme set by SDL_HapticDirection.
453 * 456 *
454 * The struct handles the following effects: 457 * The struct handles the following effects:
455 * - SDL_HAPTIC_SPRING: Effect based on axes position. 458 * - SDL_HAPTIC_SPRING: Effect based on axes position.
456 * - SDL_HAPTIC_DAMPER: Effect based on axes velocity. 459 * - SDL_HAPTIC_DAMPER: Effect based on axes velocity.
457 * - SDL_HAPTIC_INERTIA: Effect based on axes acceleration. 460 * - SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
458 * - SDL_HAPTIC_FRICTION: Effect based on axes movement. 461 * - SDL_HAPTIC_FRICTION: Effect based on axes movement.
459 * 462 *
463 * \sa SDL_HapticDirection
460 * \sa SDL_HAPTIC_SPRING 464 * \sa SDL_HAPTIC_SPRING
461 * \sa SDL_HAPTIC_DAMPER 465 * \sa SDL_HAPTIC_DAMPER
462 * \sa SDL_HAPTIC_INERTIA 466 * \sa SDL_HAPTIC_INERTIA
463 * \sa SDL_HAPTIC_FRICTION 467 * \sa SDL_HAPTIC_FRICTION
464 * \sa SDL_HapticEffect 468 * \sa SDL_HapticEffect
474 /* Trigger */ 478 /* Trigger */
475 Uint16 button; /**< Button that triggers the effect. */ 479 Uint16 button; /**< Button that triggers the effect. */
476 Uint16 interval; /**< How soon it can be triggered again after button. */ 480 Uint16 interval; /**< How soon it can be triggered again after button. */
477 481
478 /* Condition */ 482 /* Condition */
479 Uint16 right_sat; /**< Level when joystick is to the right. */ 483 Uint16 right_sat[2]; /**< Level when joystick is to the right. */
480 Uint16 left_sat; /**< Level when joystick is to the left. */ 484 Uint16 left_sat[2]; /**< Level when joystick is to the left. */
481 Sint16 right_coeff; /**< How fast to increase the force towards the right. */ 485 Sint16 right_coeff[2]; /**< How fast to increase the force towards the right. */
482 Sint16 left_coeff; /**< How fast to increase the force towards the left. */ 486 Sint16 left_coeff[2]; /**< How fast to increase the force towards the left. */
483 Uint16 deadband; /**< Size of the dead zone. */ 487 Uint16 deadband[2]; /**< Size of the dead zone. */
484 Sint16 center; /**< Position of the dead zone. */ 488 Sint16 center[2]; /**< Position of the dead zone. */
485 } SDL_HapticCondition; 489 } SDL_HapticCondition;
486 /** 490 /**
487 * \struct SDL_HapticRamp 491 * \struct SDL_HapticRamp
488 * 492 *
489 * \brief A structure containing a template for a Ramp effect. 493 * \brief A structure containing a template for a Ramp effect.
572 typedef union SDL_HapticEffect { 576 typedef union SDL_HapticEffect {
573 /* Common for all force feedback effects */ 577 /* Common for all force feedback effects */
574 Uint16 type; /**< Effect type. */ 578 Uint16 type; /**< Effect type. */
575 SDL_HapticConstant constant; /**< Constant effect. */ 579 SDL_HapticConstant constant; /**< Constant effect. */
576 SDL_HapticPeriodic periodic; /**< Periodic effect. */ 580 SDL_HapticPeriodic periodic; /**< Periodic effect. */
577 SDL_HapticCondition condition[2]; /**< Condition effect, one for each axis. */ 581 SDL_HapticCondition condition; /**< Condition effect. */
578 SDL_HapticRamp ramp; /**< Ramp effect. */ 582 SDL_HapticRamp ramp; /**< Ramp effect. */
579 } SDL_HapticEffect; 583 } SDL_HapticEffect;
580 584
581 585
582 /* Function prototypes */ 586 /* Function prototypes */