aboutsummaryrefslogtreecommitdiff
path: root/core/bind
diff options
context:
space:
mode:
authorhurikhan2015-02-15 17:49:34 +0800
committerhurikhan2015-02-15 17:49:34 +0800
commitee81d4b359ec5dbeaed5725739ba53b7734372cd (patch)
tree50bff1e6e336fe66d0f58c00841403ce091d3f1c /core/bind
parenta13e180052d2e17275498a2fa78185cc299ace11 (diff)
parent2185c018f6593e6d64b2beb62202d2291e2e008e (diff)
downloadgodot-ee81d4b359ec5dbeaed5725739ba53b7734372cd.tar.gz
godot-ee81d4b359ec5dbeaed5725739ba53b7734372cd.tar.zst
godot-ee81d4b359ec5dbeaed5725739ba53b7734372cd.zip
Merge remote-tracking branch 'upstream/master' into x11-window-management
Diffstat (limited to 'core/bind')
-rw-r--r--core/bind/core_bind.cpp14
-rw-r--r--core/bind/core_bind.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 6919c70a5..39c5761d6 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -385,6 +385,11 @@ float _OS::get_time_scale() {
return OS::get_singleton()->get_time_scale();
}
+bool _OS::is_ok_left_and_cancel_right() const {
+
+ return OS::get_singleton()->get_swap_ok_cancel();
+}
+
/*
enum Weekday {
DAY_SUNDAY,
@@ -788,6 +793,8 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir);
ObjectTypeDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID);
+ ObjectTypeDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right);
+
ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second);
ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size);
@@ -927,6 +934,12 @@ Variant _Geometry::segment_intersects_triangle( const Vector3& p_from, const Vec
return Variant();
}
+
+bool _Geometry::point_is_inside_triangle(const Vector2& s, const Vector2& a, const Vector2& b, const Vector2& c) const {
+
+ return Geometry::is_point_in_triangle(s,a,b,c);
+}
+
DVector<Vector3> _Geometry::segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius) {
DVector<Vector3> r;
@@ -1027,6 +1040,7 @@ void _Geometry::_bind_methods() {
ObjectTypeDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere);
ObjectTypeDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder);
ObjectTypeDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex);
+ ObjectTypeDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle);
ObjectTypeDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index b6f4f8eef..e77ed9e40 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -240,6 +240,8 @@ public:
void set_time_scale(float p_scale);
float get_time_scale();
+ bool is_ok_left_and_cancel_right() const;
+
static _OS *get_singleton() { return singleton; }
_OS();
@@ -268,6 +270,8 @@ public:
Vector3 get_closest_point_to_segment(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b);
Variant ray_intersects_triangle( const Vector3& p_from, const Vector3& p_dir, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2);
Variant segment_intersects_triangle( const Vector3& p_from, const Vector3& p_to, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2);
+ bool point_is_inside_triangle(const Vector2& s, const Vector2& a, const Vector2& b, const Vector2& c) const;
+
DVector<Vector3> segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius);
DVector<Vector3> segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius);
DVector<Vector3> segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes);