Record Class SDL_HapticCondition
- All Implemented Interfaces:
IPointer
,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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfShort
static final SequenceLayout
static final SequenceLayout
static final ValueLayout.OfShort
static final StructLayout
static final ValueLayout.OfShort
static final SequenceLayout
static final SequenceLayout
static final ValueLayout.OfInt
static final SequenceLayout
static final SequenceLayout
static final ValueLayout.OfShort
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_HapticCondition
(@NotNull MemorySegment segment) Creates an instance of aSDL_HapticCondition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_HapticCondition
static SDL_HapticCondition.Ptr
short
button()
button
(short value) center()
static SDL_HapticCondition
clone
(Arena arena, SDL_HapticCondition src) deadband()
short
delay()
delay
(short value) @NotNull SDL_HapticDirection
direction
(@NotNull SDL_HapticDirection value) direction
(Consumer<@NotNull SDL_HapticDirection> consumer) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.short
interval()
interval
(short value) left_coeff
(ShortPtr value) left_sat()
int
length()
length
(int value) right_coeff
(ShortPtr value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.short
type()
type
(short value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$type
-
PATH$direction
-
PATH$length
-
PATH$delay
-
PATH$button
-
PATH$interval
-
PATH$right_sat
-
PATH$left_sat
-
PATH$right_coeff
-
PATH$left_coeff
-
PATH$deadband
-
PATH$center
-
LAYOUT$type
-
LAYOUT$direction
-
LAYOUT$length
-
LAYOUT$delay
-
LAYOUT$button
-
LAYOUT$interval
-
LAYOUT$right_sat
-
LAYOUT$left_sat
-
LAYOUT$right_coeff
-
LAYOUT$left_coeff
-
LAYOUT$deadband
-
LAYOUT$center
-
SIZE$type
public static final long SIZE$type -
SIZE$direction
public static final long SIZE$direction -
SIZE$length
public static final long SIZE$length -
SIZE$delay
public static final long SIZE$delay -
SIZE$button
public static final long SIZE$button -
SIZE$interval
public static final long SIZE$interval -
SIZE$right_sat
public static final long SIZE$right_sat -
SIZE$left_sat
public static final long SIZE$left_sat -
SIZE$right_coeff
public static final long SIZE$right_coeff -
SIZE$left_coeff
public static final long SIZE$left_coeff -
SIZE$deadband
public static final long SIZE$deadband -
SIZE$center
public static final long SIZE$center -
OFFSET$type
public static final long OFFSET$type -
OFFSET$direction
public static final long OFFSET$direction -
OFFSET$length
public static final long OFFSET$length -
OFFSET$delay
public static final long OFFSET$delay -
OFFSET$button
public static final long OFFSET$button -
OFFSET$interval
public static final long OFFSET$interval -
OFFSET$right_sat
public static final long OFFSET$right_sat -
OFFSET$left_sat
public static final long OFFSET$left_sat -
OFFSET$right_coeff
public static final long OFFSET$right_coeff -
OFFSET$left_coeff
public static final long OFFSET$left_coeff -
OFFSET$deadband
public static final long OFFSET$deadband -
OFFSET$center
public static final long OFFSET$center
-
-
Constructor Details
-
SDL_HapticCondition
Creates an instance of aSDL_HapticCondition
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
type
-
type
-
direction
-
direction
-
direction
-
length
-
length
-
delay
-
delay
-
button
-
button
-
interval
-
interval
-
right_sat
-
right_sat
-
right_satRaw
-
left_sat
-
left_sat
-
left_satRaw
-
right_coeff
-
right_coeff
-
right_coeffRaw
-
left_coeff
-
left_coeff
-
left_coeffRaw
-
deadband
-
deadband
-
deadbandRaw
-
center
-
center
-
centerRaw
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-