mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Removed add/remove interface bindings and added get_interfaces
This commit is contained in:
committed by
Bastiaan Olij
parent
2fce0010f0
commit
9d3f8418ca
@@ -49,15 +49,13 @@ void ARVRServer::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_interface_count"), &ARVRServer::get_interface_count);
|
||||
ClassDB::bind_method(D_METHOD("get_interface", "idx"), &ARVRServer::get_interface);
|
||||
ClassDB::bind_method(D_METHOD("get_interfaces"), &ARVRServer::get_interfaces);
|
||||
ClassDB::bind_method(D_METHOD("find_interface", "name"), &ARVRServer::find_interface);
|
||||
ClassDB::bind_method(D_METHOD("get_tracker_count"), &ARVRServer::get_tracker_count);
|
||||
ClassDB::bind_method(D_METHOD("get_tracker", "idx"), &ARVRServer::get_tracker);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_primary_interface", "interface"), &ARVRServer::set_primary_interface);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_interface", "interface"), &ARVRServer::add_interface);
|
||||
ClassDB::bind_method(D_METHOD("remove_interface", "interface"), &ARVRServer::remove_interface);
|
||||
|
||||
BIND_ENUM_CONSTANT(TRACKER_CONTROLLER);
|
||||
BIND_ENUM_CONSTANT(TRACKER_BASESTATION);
|
||||
BIND_ENUM_CONSTANT(TRACKER_ANCHOR);
|
||||
@@ -191,6 +189,21 @@ Ref<ARVRInterface> ARVRServer::find_interface(const String &p_name) const {
|
||||
return interfaces[idx];
|
||||
};
|
||||
|
||||
Array ARVRServer::get_interfaces() const {
|
||||
Array ret;
|
||||
|
||||
for (int i = 0; i < interfaces.size(); i++) {
|
||||
Dictionary iface_info;
|
||||
|
||||
iface_info["id"] = i;
|
||||
iface_info["name"] = interfaces[i]->get_name();
|
||||
|
||||
ret.push_back(iface_info);
|
||||
};
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
/*
|
||||
A little extra info on the tracker ids, these are unique per tracker type so we get soem consistency in recognising our trackers, specifically controllers.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user