83 lines
2.1 KiB
C++
83 lines
2.1 KiB
C++
#ifndef ULTRALEAP_DIGIT_H
|
|
#define ULTRALEAP_DIGIT_H
|
|
|
|
#include <godot_cpp/classes/global_constants.hpp>
|
|
#include <godot_cpp/classes/ref.hpp>
|
|
#include <godot_cpp/core/binder_common.hpp>
|
|
#include <godot_cpp/core/object.hpp>
|
|
|
|
#include <godot_cpp/variant/vector3.hpp>
|
|
#include <godot_cpp/variant/quaternion.hpp>
|
|
|
|
#include <LeapC.h>
|
|
|
|
#include "bone.h"
|
|
#include "types.h"
|
|
|
|
using namespace godot;
|
|
|
|
class UltraleapDigit : public Resource {
|
|
GDCLASS(UltraleapDigit, Resource);
|
|
|
|
public:
|
|
|
|
enum FingerType {
|
|
Thumb,
|
|
Index,
|
|
Middle,
|
|
Ring,
|
|
Pinky,
|
|
None
|
|
};
|
|
|
|
FingerType type = None;
|
|
|
|
bool is_extended;
|
|
|
|
// Getters / Setters
|
|
FingerType get_type() { return type; }
|
|
void set_type(FingerType value) { type = value; }
|
|
|
|
Ref<UltraleapBone> get_metacarpal() { return metacarpal_ref; }
|
|
void set_metacarpal(Ref<UltraleapBone> value) { metacarpal_ref = value; }
|
|
|
|
Ref<UltraleapBone> get_proximal() { return proximal_ref; }
|
|
void set_proximal(Ref<UltraleapBone> value) { proximal_ref = value; }
|
|
|
|
Ref<UltraleapBone> get_intermediate() { return intermediate_ref; }
|
|
void set_intermediate(Ref<UltraleapBone> value) { intermediate_ref = value; }
|
|
|
|
Ref<UltraleapBone> get_distal() { return distal_ref; }
|
|
void set_distal(Ref<UltraleapBone> value) { distal_ref = value; }
|
|
|
|
bool get_is_extended() { return is_extended; }
|
|
void set_is_extended(bool value) { is_extended = value; }
|
|
|
|
Array get_bones() {
|
|
if (bones == Variant::NIL) {
|
|
bones = Array();
|
|
}
|
|
if (bones.size() == 0) {
|
|
bones.append(metacarpal_ref);
|
|
bones.append(proximal_ref);
|
|
bones.append(intermediate_ref);
|
|
bones.append(distal_ref);
|
|
}
|
|
return bones;
|
|
}
|
|
|
|
static void fill_digit_data(Ref<UltraleapDigit> ul_digit, LEAP_DIGIT* digit, FingerType type, LEAP_PALM* palm);
|
|
protected:
|
|
static void _bind_methods();
|
|
|
|
private:
|
|
Ref<UltraleapBone> metacarpal_ref;
|
|
Ref<UltraleapBone> proximal_ref;
|
|
Ref<UltraleapBone> intermediate_ref;
|
|
Ref<UltraleapBone> distal_ref;
|
|
Array bones;
|
|
};
|
|
|
|
VARIANT_ENUM_CAST(UltraleapDigit::FingerType);
|
|
|
|
#endif |