Record Class SDL_HapticCondition

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_HapticCondition
All Implemented Interfaces:
IPointer, ISDL_HapticCondition

@ValueBasedCandidate @UnsafeConstructor public record SDL_HapticCondition(@NotNull MemorySegment segment) extends Record implements ISDL_HapticCondition

A structure containing a template for a Condition effect.

The struct handles the following effects:

  • SDL_HAPTIC_SPRING: Effect based on axes position.
  • SDL_HAPTIC_DAMPER: Effect based on axes velocity.
  • SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
  • SDL_HAPTIC_FRICTION: Effect based on axes movement.

Direction is handled by condition internals instead of a direction member. The condition effect specific members have three parameters. The first refers to the X axis, the second refers to the Y axis and the third refers to the Z axis. The right terms refer to the positive side of the axis and the left terms refer to the negative side of the axis. Please refer to the SDL_HapticDirection diagram for which side is positive and which is negative.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_HapticDirection
  • SDL_HAPTIC_SPRING
  • SDL_HAPTIC_DAMPER
  • SDL_HAPTIC_INERTIA
  • SDL_HAPTIC_FRICTION
  • SDL_HapticEffect

Structure

typedef struct SDL_HapticCondition {
    Uint16 type;
    SDL_HapticDirection direction;
    Uint32 length;
    Uint16 delay;
    Uint16 button;
    Uint16 interval;
    Uint16[3] right_sat;
    Uint16[3] left_sat;
    Sint16[3] right_coeff;
    Sint16[3] left_coeff;
    Uint16[3] deadband;
    Sint16[3] center;
} SDL_HapticCondition;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.