void GetValue( float t, System.Single& frequency, System.Single& amplitude )

book_4_sparkGenerated
code_blocksInput

Description

The GetValue method of the HapticPattern class is used to retrieve the frequency and amplitude values at a specific point in time within the haptic pattern. This method is useful for generating haptic feedback that varies over time, allowing for dynamic and responsive user experiences.

Usage

To use the GetValue method, you need to provide a time parameter t which represents the point in time within the haptic pattern. The method will output the frequency and amplitude values at that specific time through the frequency and amplitude parameters, respectively.

Ensure that the time t is within the valid range of the haptic pattern's duration to get meaningful results.

Example

// Example usage of HapticPattern.GetValue
HapticPattern pattern = new HapticPattern();
float time = 0.5f; // Time within the pattern
float frequency;
float amplitude;

// Retrieve frequency and amplitude at the specified time
pattern.GetValue(time, out frequency, out amplitude);

// Use frequency and amplitude for haptic feedback
// For example, apply these values to a haptic device