godot-ultraleap-plugin/src/frame.h
rodolpheh 8b932e3a3c Try to improve stability in editor
The more I made changes, the more it crashed. Got it to a point where
it doesn't crash when starting the editor, but it will crash when
exciting.
2023-11-08 22:47:41 +00:00

53 lines
1.4 KiB
C++

#ifndef ULTRALEAP_FRAME_H
#define ULTRALEAP_FRAME_H
#include <godot_cpp/classes/global_constants.hpp>
#include <godot_cpp/classes/resource.hpp>
#include <godot_cpp/classes/ref.hpp>
#include <godot_cpp/core/binder_common.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
#include <LeapC.h>
#include "hand.h"
using namespace godot;
class UltraleapFrame : public Resource {
GDCLASS(UltraleapFrame, Resource);
public:
uint32_t id;
bool is_left_hand_visible = false;
bool is_right_hand_visible = false;
float framerate;
Variant get_left_hand() { return left_hand_ref; }
void set_left_hand(Variant value) { return; }
Variant get_right_hand() { return right_hand_ref; }
void set_right_hand(Variant value) { return; }
bool get_is_left_hand_visible() { return is_left_hand_visible; }
void set_is_left_hand_visible(bool value) { return; }
bool get_is_right_hand_visible() { return is_right_hand_visible; }
void set_is_right_hand_visible(bool value) { return; }
float get_framerate() { return framerate; }
void set_framerate(float value) { return; }
static void fill_frame_data(Ref<UltraleapFrame> ul_frame, const LEAP_TRACKING_EVENT* frame);
protected:
static void _bind_methods();
private:
Ref<UltraleapHand> left_hand_ref = Ref<UltraleapHand>(memnew(UltraleapHand));
Ref<UltraleapHand> right_hand_ref = Ref<UltraleapHand>(memnew(UltraleapHand));
};
#endif