Record Class SDL_HapticPeriodic
- All Implemented Interfaces:
IPointer
,ISDL_HapticPeriodic
A structure containing a template for a Periodic effect.
The struct handles the following effects:
- SDL_HAPTIC_SINE
- SDL_HAPTIC_SQUARE
- SDL_HAPTIC_TRIANGLE
- SDL_HAPTIC_SAWTOOTHUP
- SDL_HAPTIC_SAWTOOTHDOWN
A periodic effect consists in a wave-shaped effect that repeats itself over time. The type determines the shape of the wave and the parameters determine the dimensions of the wave.
Phase is given by hundredth of a degree meaning that giving the phase a value of 9000 will displace it 25% of its period. Here are sample values:
- 0: No phase displacement.
- 9000: Displaced 25% of its period.
- 18000: Displaced 50% of its period.
- 27000: Displaced 75% of its period.
- 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
Examples:
SDL_HAPTIC_SINE
__ __ __ __
/ \ / \ / \ /
/ \__/ \__/ \__/
SDL_HAPTIC_SQUARE
__ __ __ __ __
| | | | | | | | | |
| |__| |__| |__| |__| |
SDL_HAPTIC_TRIANGLE
/\ /\ /\ /\ /\
/ \ / \ / \ / \ /
/ \/ \/ \/ \/
SDL_HAPTIC_SAWTOOTHUP
/| /| /| /| /| /| /|
/ | / | / | / | / | / | / |
/ |/ |/ |/ |/ |/ |/ |
SDL_HAPTIC_SAWTOOTHDOWN
\ |\ |\ |\ |\ |\ |\ |
\ | \ | \ | \ | \ | \ | \ |
\| \| \| \| \| \| \|
Since: This struct is available since SDL 3.2.0.
See also:
SDL_HAPTIC_SINE
SDL_HAPTIC_SQUARE
SDL_HAPTIC_TRIANGLE
SDL_HAPTIC_SAWTOOTHUP
SDL_HAPTIC_SAWTOOTHDOWN
SDL_HapticEffect
Structure
typedef struct SDL_HapticPeriodic {
Uint16 type
;
SDL_HapticDirection
direction
;
Uint32 length
;
Uint16 delay
;
Uint16 button
;
Uint16 interval
;
Uint16 period
;
Sint16 magnitude
;
Sint16 offset
;
Uint16 phase
;
Uint16 attack_length
;
Uint16 attack_level
;
Uint16 fade_length
;
Uint16 fade_level
;
} SDL_HapticPeriodic;
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 ValueLayout.OfShort
static final ValueLayout.OfShort
static final ValueLayout.OfShort
static final StructLayout
static final ValueLayout.OfShort
static final ValueLayout.OfShort
static final ValueLayout.OfShort
static final ValueLayout.OfInt
static final ValueLayout.OfShort
static final ValueLayout.OfShort
static final ValueLayout.OfShort
static final ValueLayout.OfShort
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 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 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
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_HapticPeriodic
(@NotNull MemorySegment segment) Creates an instance of aSDL_HapticPeriodic
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_HapticPeriodic
static SDL_HapticPeriodic.Ptr
short
attack_length
(short value) short
attack_level
(short value) short
button()
button
(short value) static SDL_HapticPeriodic
clone
(Arena arena, SDL_HapticPeriodic src) 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.short
fade_length
(short value) short
fade_level
(short value) final int
hashCode()
Returns a hash code value for this object.short
interval()
interval
(short value) int
length()
length
(int value) short
magnitude
(short value) short
offset()
offset
(short value) short
period()
period
(short value) short
phase()
phase
(short 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$period
-
PATH$magnitude
-
PATH$offset
-
PATH$phase
-
PATH$attack_length
-
PATH$attack_level
-
PATH$fade_length
-
PATH$fade_level
-
LAYOUT$type
-
LAYOUT$direction
-
LAYOUT$length
-
LAYOUT$delay
-
LAYOUT$button
-
LAYOUT$interval
-
LAYOUT$period
-
LAYOUT$magnitude
-
LAYOUT$offset
-
LAYOUT$phase
-
LAYOUT$attack_length
-
LAYOUT$attack_level
-
LAYOUT$fade_length
-
LAYOUT$fade_level
-
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$period
public static final long SIZE$period -
SIZE$magnitude
public static final long SIZE$magnitude -
SIZE$offset
public static final long SIZE$offset -
SIZE$phase
public static final long SIZE$phase -
SIZE$attack_length
public static final long SIZE$attack_length -
SIZE$attack_level
public static final long SIZE$attack_level -
SIZE$fade_length
public static final long SIZE$fade_length -
SIZE$fade_level
public static final long SIZE$fade_level -
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$period
public static final long OFFSET$period -
OFFSET$magnitude
public static final long OFFSET$magnitude -
OFFSET$offset
public static final long OFFSET$offset -
OFFSET$phase
public static final long OFFSET$phase -
OFFSET$attack_length
public static final long OFFSET$attack_length -
OFFSET$attack_level
public static final long OFFSET$attack_level -
OFFSET$fade_length
public static final long OFFSET$fade_length -
OFFSET$fade_level
public static final long OFFSET$fade_level
-
-
Constructor Details
-
SDL_HapticPeriodic
Creates an instance of aSDL_HapticPeriodic
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
-
period
-
period
-
magnitude
-
magnitude
-
offset
-
offset
-
phase
-
phase
-
attack_length
-
attack_length
-
attack_level
-
attack_level
-
fade_length
-
fade_length
-
fade_level
-
fade_level
-
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.
-