Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/openxr/action_map/openxr_action_set.h
10278 views
1
/**************************************************************************/
2
/* openxr_action_set.h */
3
/**************************************************************************/
4
/* This file is part of: */
5
/* GODOT ENGINE */
6
/* https://godotengine.org */
7
/**************************************************************************/
8
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10
/* */
11
/* Permission is hereby granted, free of charge, to any person obtaining */
12
/* a copy of this software and associated documentation files (the */
13
/* "Software"), to deal in the Software without restriction, including */
14
/* without limitation the rights to use, copy, modify, merge, publish, */
15
/* distribute, sublicense, and/or sell copies of the Software, and to */
16
/* permit persons to whom the Software is furnished to do so, subject to */
17
/* the following conditions: */
18
/* */
19
/* The above copyright notice and this permission notice shall be */
20
/* included in all copies or substantial portions of the Software. */
21
/* */
22
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29
/**************************************************************************/
30
31
#pragma once
32
33
#include "openxr_action.h"
34
35
#include "core/io/resource.h"
36
37
class OpenXRActionSet : public Resource {
38
GDCLASS(OpenXRActionSet, Resource);
39
40
private:
41
String localized_name;
42
int priority = 0;
43
44
Array actions;
45
void clear_actions();
46
47
protected:
48
static void _bind_methods();
49
50
public:
51
static Ref<OpenXRActionSet> new_action_set(const char *p_name, const char *p_localized_name, const int p_priority = 0); // Helper function for adding and setting up an action set
52
53
void set_localized_name(const String p_localized_name); // Set the localized name of this action set
54
String get_localized_name() const; // Get the localized name of this action set
55
56
void set_priority(const int p_priority); // Set the priority of this action set
57
int get_priority() const; // Get the priority of this action set
58
59
int get_action_count() const; // Retrieve the number of actions in our action set
60
void set_actions(Array p_actions); // Set our actions using an array of actions (for loading a resource)
61
Array get_actions() const; // Get our actions as an array (for saving a resource)
62
63
Ref<OpenXRAction> get_action(const String p_name) const; // Retrieve an action by name
64
void add_action(Ref<OpenXRAction> p_action); // Add a new action to our action set
65
void remove_action(Ref<OpenXRAction> p_action); // remove a action from our action set
66
67
Ref<OpenXRAction> add_new_action(const char *p_name, const char *p_localized_name, const OpenXRAction::ActionType p_action_type, const char *p_toplevel_paths); // Helper function for adding and setting up an action
68
69
// TODO add validation to display in the interface that checks if we have duplicate action names within our action set
70
71
~OpenXRActionSet();
72
};
73
74