-
Notifications
You must be signed in to change notification settings - Fork 0
engine_events
Interhaptics Docs Section: Engine Events
This module contains the functions related to Engine Events.
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
- interhaptics_play_event
- interhaptics_stop_event
- interhaptics_stop_all_events
- interhaptics_add_target_to_event
- interhaptics_remove_target_from_event
- interhaptics_remove_all_targets_from_event
- interhaptics_compute_all_events
- interhaptics_update_event_positions
- interhaptics_set_event_offsets
- interhaptics_set_event_intensity
- interhaptics_set_event_loop
- interhaptics_set_target_intensity
- interhaptics_clear_inactive_events
- interhaptics_clear_active_events
- interhaptics_clear_event
This function starts the rendering playback of a haptic source. Sets the starting time to 0 + different offsets. If the event is already playing, it restarts with the new offets. If the source does not already exist, it will be created.
Syntax:
interhaptics_play_event(material_ref, vibration_offset, texture_offset, stiffness_offset)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source to play, which is the same as the attached haptic effect. |
vibration_offset | Real | The vibration offset for the source. |
texture_offset | Real | The texture offset for the source. |
stiffness_offset | Real | The stiffness offset for the source. |
Returns:
N/A
This function stops the rendering playback of a haptic source.
Syntax:
interhaptics_stop_event(material_ref)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source to stop, which is the same as the attached haptic effect. |
Returns:
N/A
This function stops the rendering playback of all haptic sources.
Syntax:
interhaptics_stop_all_events()
Returns:
N/A
This function adds a target within the range of the source. The Interhaptics Engine will remap device endpoints and in-range targets to the device management layer for haptic playback.
Syntax:
interhaptics_add_target_to_event(material_ref, target)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source to add a target to, which is the same as the attached haptic effect. |
target | Array of Interhaptics_CommandData | A target contains a group of body parts, lateral flags, and exclusion flags. |
Returns:
N/A
This function adds a target within the range of the source. The Interhaptics Engine will remap device endpoints and in-range targets to the device management layer for haptic playback.
Syntax:
interhaptics_remove_target_from_event(material_ref, target)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source to add a target to, which is the same as the attached haptic effect. |
target | Array of Interhaptics_CommandData | An array of Interhaptics_CommandData to build a target. A target contains a group of body parts, lateral flags, and exclusion flags. Only perfectly matching targets will be removed. |
Returns:
N/A
This function removes all targets from a source range. The Interhaptics Engine will remap device endpoints and in-range targets to the device management layer for haptic playback.
Syntax:
interhaptics_remove_all_targets_from_event(material_ref)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source to remove all targets from, which is the same as the attached haptic effect. |
Returns:
N/A
This function must be called in the application main loop to trigger the rendering of all haptic buffers at a specific time. The Interhaptics Engine will compare the current time with the last known value to build a buffer large enough to cover frame drops. This function can be called from the main thread or in a parallel loop. It must be called at least once before triggering the device update event.
Syntax:
interhaptics_compute_all_events(current_time)
Argument | Type | Description |
---|---|---|
current_time | Real | The current time in seconds. |
Returns:
N/A
This function updates the spatial positions for a specific source target.
Syntax:
interhaptics_update_event_positions(material_ref, target, texture_position, stiffness_position)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
target | Array of Interhaptics_CommandData | A vector of Interhaptics_CommandData to build a target. A target contains a group of body parts, lateral flags, and exclusion flags. Only perfectly matching targets will be updated. |
texture_position | Real | The new texture position. |
stiffness_position | Real | The new stiffness position. |
Returns:
N/A
This function sets the offsets for a specific haptic source.
Syntax:
interhaptics_set_event_offsets(material_ref, vibration_offset, texture_offset, stiffness_offet)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
vibration_offset | Real | The vibration offset. |
texture_offset | Real | The texture offset. |
stiffness_offet | Real | The stiffness offset. |
Returns:
N/A
This function clears all inactive sources from memory. Inactive sources are kept in memory to avoid deletion and creation when playing and stopping a source.
Syntax:
interhaptics_clear_inactive_events()
Returns:
N/A
This function clears all active sources from memory. Deleted sources can be recreated by calling the interhaptics_play_event function.
Syntax:
interhaptics_clear_active_events()
Returns:
N/A
This function clears a specific haptic source, whether it is active or not.
Syntax:
interhaptics_clear_event(material_ref)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
Returns:
N/A
This function sets the haptics intensity factor for a specific source.
Syntax:
interhaptics_set_event_intensity(material_ref, intensity)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
intensity | Real | The intensity factor value. Always clamped above 0. |
Returns:
N/A
This function sets the loop flag for a specific source.
Syntax:
interhaptics_set_event_loop(material_ref, number_of_loops)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
number_of_loops | Real | The number of loops for the event. <= 1 is one iteration. |
Returns:
N/A
This function sets the haptics intensity factor for a specific target of a source.
Syntax:
interhaptics_set_target_intensity(material_ref, target, intensity)
Argument | Type | Description |
---|---|---|
material_ref | Real | The ID of the source, which is the same as the attached haptic effect. |
target | Array of Interhaptics_CommandData | The target to change intensity. |
intensity | Real | The intensity factor value. Always clamped above 0. |
Returns:
N/A
GameMaker 2024