Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
0e0b6ec4
Commit
0e0b6ec4
authored
Mar 04, 2017
by
Pedro J. Estébanez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose uncapped versions of closest-point-to-segment utilities
parent
ee53f85b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
core_bind.cpp
core/bind/core_bind.cpp
+13
-0
core_bind.h
core/bind/core_bind.h
+2
-0
No files found.
core/bind/core_bind.cpp
View file @
0e0b6ec4
...
...
@@ -1226,6 +1226,16 @@ Vector3 _Geometry::get_closest_point_to_segment(const Vector3& p_point, const Ve
Vector3
s
[
2
]
=
{
p_a
,
p_b
};
return
Geometry
::
get_closest_point_to_segment
(
p_point
,
s
);
}
Vector2
_Geometry
::
get_closest_point_to_segment_uncapped_2d
(
const
Vector2
&
p_point
,
const
Vector2
&
p_a
,
const
Vector2
&
p_b
)
{
Vector2
s
[
2
]
=
{
p_a
,
p_b
};
return
Geometry
::
get_closest_point_to_segment_uncapped_2d
(
p_point
,
s
);
}
Vector3
_Geometry
::
get_closest_point_to_segment_uncapped
(
const
Vector3
&
p_point
,
const
Vector3
&
p_a
,
const
Vector3
&
p_b
)
{
Vector3
s
[
2
]
=
{
p_a
,
p_b
};
return
Geometry
::
get_closest_point_to_segment_uncapped
(
p_point
,
s
);
}
Variant
_Geometry
::
ray_intersects_triangle
(
const
Vector3
&
p_from
,
const
Vector3
&
p_dir
,
const
Vector3
&
p_v0
,
const
Vector3
&
p_v1
,
const
Vector3
&
p_v2
)
{
Vector3
res
;
...
...
@@ -1344,6 +1354,9 @@ void _Geometry::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_closest_point_to_segment"
,
"point"
,
"s1"
,
"s2"
),
&
_Geometry
::
get_closest_point_to_segment
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_closest_point_to_segment_uncapped_2d"
,
"point"
,
"s1"
,
"s2"
),
&
_Geometry
::
get_closest_point_to_segment_uncapped_2d
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_closest_point_to_segment_uncapped"
,
"point"
,
"s1"
,
"s2"
),
&
_Geometry
::
get_closest_point_to_segment_uncapped
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_uv84_normal_bit"
,
"normal"
),
&
_Geometry
::
get_uv84_normal_bit
);
ClassDB
::
bind_method
(
D_METHOD
(
"ray_intersects_triangle"
,
"from"
,
"dir"
,
"a"
,
"b"
,
"c"
),
&
_Geometry
::
ray_intersects_triangle
);
...
...
core/bind/core_bind.h
View file @
0e0b6ec4
...
...
@@ -335,6 +335,8 @@ public:
PoolVector
<
Vector2
>
get_closest_points_between_segments_2d
(
const
Vector2
&
p1
,
const
Vector2
&
q1
,
const
Vector2
&
p2
,
const
Vector2
&
q2
);
PoolVector
<
Vector3
>
get_closest_points_between_segments
(
const
Vector3
&
p1
,
const
Vector3
&
p2
,
const
Vector3
&
q1
,
const
Vector3
&
q2
);
Vector3
get_closest_point_to_segment
(
const
Vector3
&
p_point
,
const
Vector3
&
p_a
,
const
Vector3
&
p_b
);
Vector2
get_closest_point_to_segment_uncapped_2d
(
const
Vector2
&
p_point
,
const
Vector2
&
p_a
,
const
Vector2
&
p_b
);
Vector3
get_closest_point_to_segment_uncapped
(
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment