diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/arvr/arvr_interface.cpp | 2 | ||||
-rw-r--r-- | servers/arvr/arvr_interface.h | 2 | ||||
-rw-r--r-- | servers/arvr_server.cpp | 19 | ||||
-rw-r--r-- | servers/arvr_server.h | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.cpp | 2 |
5 files changed, 20 insertions, 6 deletions
diff --git a/servers/arvr/arvr_interface.cpp b/servers/arvr/arvr_interface.cpp index 55707def7c..458459a843 100644 --- a/servers/arvr/arvr_interface.cpp +++ b/servers/arvr/arvr_interface.cpp @@ -43,7 +43,7 @@ void ARVRInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tracking_status"), &ARVRInterface::get_tracking_status); - ClassDB::bind_method(D_METHOD("get_recommended_render_targetsize"), &ARVRInterface::get_recommended_render_targetsize); + ClassDB::bind_method(D_METHOD("get_render_targetsize"), &ARVRInterface::get_render_targetsize); ClassDB::bind_method(D_METHOD("is_stereo"), &ARVRInterface::is_stereo); ADD_GROUP("Interface", "interface_"); diff --git a/servers/arvr/arvr_interface.h b/servers/arvr/arvr_interface.h index 880f6e4595..1599c1a64f 100644 --- a/servers/arvr/arvr_interface.h +++ b/servers/arvr/arvr_interface.h @@ -103,7 +103,7 @@ public: /** rendering and internal **/ - virtual Size2 get_recommended_render_targetsize() = 0; /* returns the recommended render target size per eye for this device */ + virtual Size2 get_render_targetsize() = 0; /* returns the recommended render target size per eye for this device */ virtual bool is_stereo() = 0; /* returns true if this interface requires stereo rendering (for VR HMDs) or mono rendering (for mobile AR) */ virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform) = 0; /* get each eyes camera transform, also implement EYE_MONO */ virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) = 0; /* get each eyes projection matrix */ diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index ede080b424..1e73d6753c 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -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. diff --git a/servers/arvr_server.h b/servers/arvr_server.h index 948895cb27..9b84ee2e99 100644 --- a/servers/arvr_server.h +++ b/servers/arvr_server.h @@ -137,6 +137,7 @@ public: int get_interface_count() const; Ref<ARVRInterface> get_interface(int p_index) const; Ref<ARVRInterface> find_interface(const String &p_name) const; + Array get_interfaces() const; /* note, more then one interface can technically be active, especially on mobile, but only one interface is used for diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 92c431e393..fbf593f5b9 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -268,7 +268,7 @@ void VisualServerViewport::draw_viewports() { if (vp->use_arvr && arvr_interface.is_valid()) { // override our size, make sure it matches our required size - Size2 size = arvr_interface->get_recommended_render_targetsize(); + Size2 size = arvr_interface->get_render_targetsize(); VSG::storage->render_target_set_size(vp->render_target, size.x, size.y); // render mono or left eye first |