| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "../action_map/openxr_binding_modifier.h" |
| 34 |
#include "../action_map/openxr_haptic_feedback.h" |
| 35 |
#include "../util.h" |
| 36 |
#include "core/io/resource.h" |
| 37 |
#include "openxr_extension_wrapper.h" |
| 38 |
|
| 39 |
class OpenXRValveAnalogThresholdExtension : public OpenXRExtensionWrapper { |
| 40 |
GDCLASS(OpenXRValveAnalogThresholdExtension, OpenXRExtensionWrapper); |
| 41 |
|
| 42 |
protected: |
| 43 |
static void _bind_methods() {} |
| 44 |
|
| 45 |
public: |
| 46 |
static OpenXRValveAnalogThresholdExtension *get_singleton(); |
| 47 |
|
| 48 |
OpenXRValveAnalogThresholdExtension(); |
| 49 |
virtual ~OpenXRValveAnalogThresholdExtension() override; |
| 50 |
|
| 51 |
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override; |
| 52 |
|
| 53 |
bool is_available(); |
| 54 |
|
| 55 |
private: |
| 56 |
static OpenXRValveAnalogThresholdExtension *singleton; |
| 57 |
|
| 58 |
bool binding_modifier_ext = false; |
| 59 |
bool threshold_ext = false; |
| 60 |
}; |
| 61 |
|
| 62 |
class OpenXRAnalogThresholdModifier : public OpenXRActionBindingModifier { |
| 63 |
GDCLASS(OpenXRAnalogThresholdModifier, OpenXRActionBindingModifier); |
| 64 |
|
| 65 |
private: |
| 66 |
XrInteractionProfileAnalogThresholdVALVE analog_threshold; |
| 67 |
Ref<OpenXRHapticBase> on_haptic; |
| 68 |
Ref<OpenXRHapticBase> off_haptic; |
| 69 |
|
| 70 |
protected: |
| 71 |
static void _bind_methods(); |
| 72 |
|
| 73 |
public: |
| 74 |
OpenXRAnalogThresholdModifier(); |
| 75 |
|
| 76 |
void set_on_threshold(float p_threshold); |
| 77 |
float get_on_threshold() const; |
| 78 |
|
| 79 |
void set_off_threshold(float p_threshold); |
| 80 |
float get_off_threshold() const; |
| 81 |
|
| 82 |
void set_on_haptic(const Ref<OpenXRHapticBase> &p_haptic); |
| 83 |
Ref<OpenXRHapticBase> get_on_haptic() const; |
| 84 |
|
| 85 |
void set_off_haptic(const Ref<OpenXRHapticBase> &p_haptic); |
| 86 |
Ref<OpenXRHapticBase> get_off_haptic() const; |
| 87 |
|
| 88 |
virtual String get_description() const override { return "Analog threshold modifier"; } |
| 89 |
virtual PackedByteArray get_ip_modification() override; |
| 90 |
}; |