summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/class_db.cpp5
-rw-r--r--core/class_db.h1
-rw-r--r--core/math/geometry.h6
3 files changed, 10 insertions, 2 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 219bdbddd8..f7b446707d 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -249,6 +249,11 @@ void ClassDB::set_current_api(APIType p_api) {
current_api = p_api;
}
+ClassDB::APIType ClassDB::get_current_api() {
+
+ return current_api;
+}
+
HashMap<StringName, ClassDB::ClassInfo> ClassDB::classes;
HashMap<StringName, StringName> ClassDB::resource_base_extensions;
HashMap<StringName, StringName> ClassDB::compat_classes;
diff --git a/core/class_db.h b/core/class_db.h
index 321682d76b..f18a7113d7 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -371,6 +371,7 @@ public:
static void init();
static void set_current_api(APIType p_api);
+ static APIType get_current_api();
static void cleanup();
};
diff --git a/core/math/geometry.h b/core/math/geometry.h
index 4b478b6b16..7347cb742a 100644
--- a/core/math/geometry.h
+++ b/core/math/geometry.h
@@ -702,9 +702,11 @@ public:
/* if we can assume that the line segment starts outside the circle (e.g. for continuous time collision detection) then the following can be skipped and we can just return the equivalent of res1 */
sqrtterm = Math::sqrt(sqrtterm);
real_t res1 = (-b - sqrtterm) / (2 * a);
- //real_t res2 = ( -b + sqrtterm ) / (2 * a);
+ real_t res2 = (-b + sqrtterm) / (2 * a);
- return (res1 >= 0 && res1 <= 1) ? res1 : -1;
+ if (res1 >= 0 && res1 <= 1) return res1;
+ if (res2 >= 0 && res2 <= 1) return res2;
+ return -1;
}
static inline Vector<Vector3> clip_polygon(const Vector<Vector3> &polygon, const Plane &p_plane) {