1 | /**************************************************************************/ |
2 | /* navigation_path_query_result_3d.cpp */ |
3 | /**************************************************************************/ |
4 | /* This file is part of: */ |
5 | /* GODOT ENGINE */ |
6 | /* https://godotengine.org */ |
7 | /**************************************************************************/ |
8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
10 | /* */ |
11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
12 | /* a copy of this software and associated documentation files (the */ |
13 | /* "Software"), to deal in the Software without restriction, including */ |
14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
17 | /* the following conditions: */ |
18 | /* */ |
19 | /* The above copyright notice and this permission notice shall be */ |
20 | /* included in all copies or substantial portions of the Software. */ |
21 | /* */ |
22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
29 | /**************************************************************************/ |
30 | |
31 | #include "navigation_path_query_result_3d.h" |
32 | |
33 | void NavigationPathQueryResult3D::set_path(const Vector<Vector3> &p_path) { |
34 | path = p_path; |
35 | } |
36 | |
37 | const Vector<Vector3> &NavigationPathQueryResult3D::get_path() const { |
38 | return path; |
39 | } |
40 | |
41 | void NavigationPathQueryResult3D::set_path_types(const Vector<int32_t> &p_path_types) { |
42 | path_types = p_path_types; |
43 | } |
44 | |
45 | const Vector<int32_t> &NavigationPathQueryResult3D::get_path_types() const { |
46 | return path_types; |
47 | } |
48 | |
49 | void NavigationPathQueryResult3D::set_path_rids(const TypedArray<RID> &p_path_rids) { |
50 | path_rids = p_path_rids; |
51 | } |
52 | |
53 | TypedArray<RID> NavigationPathQueryResult3D::get_path_rids() const { |
54 | return path_rids; |
55 | } |
56 | |
57 | void NavigationPathQueryResult3D::set_path_owner_ids(const Vector<int64_t> &p_path_owner_ids) { |
58 | path_owner_ids = p_path_owner_ids; |
59 | } |
60 | |
61 | const Vector<int64_t> &NavigationPathQueryResult3D::get_path_owner_ids() const { |
62 | return path_owner_ids; |
63 | } |
64 | |
65 | void NavigationPathQueryResult3D::reset() { |
66 | path.clear(); |
67 | path_types.clear(); |
68 | path_rids.clear(); |
69 | path_owner_ids.clear(); |
70 | } |
71 | |
72 | void NavigationPathQueryResult3D::_bind_methods() { |
73 | ClassDB::bind_method(D_METHOD("set_path" , "path" ), &NavigationPathQueryResult3D::set_path); |
74 | ClassDB::bind_method(D_METHOD("get_path" ), &NavigationPathQueryResult3D::get_path); |
75 | |
76 | ClassDB::bind_method(D_METHOD("set_path_types" , "path_types" ), &NavigationPathQueryResult3D::set_path_types); |
77 | ClassDB::bind_method(D_METHOD("get_path_types" ), &NavigationPathQueryResult3D::get_path_types); |
78 | |
79 | ClassDB::bind_method(D_METHOD("set_path_rids" , "path_rids" ), &NavigationPathQueryResult3D::set_path_rids); |
80 | ClassDB::bind_method(D_METHOD("get_path_rids" ), &NavigationPathQueryResult3D::get_path_rids); |
81 | |
82 | ClassDB::bind_method(D_METHOD("set_path_owner_ids" , "path_owner_ids" ), &NavigationPathQueryResult3D::set_path_owner_ids); |
83 | ClassDB::bind_method(D_METHOD("get_path_owner_ids" ), &NavigationPathQueryResult3D::get_path_owner_ids); |
84 | |
85 | ClassDB::bind_method(D_METHOD("reset" ), &NavigationPathQueryResult3D::reset); |
86 | |
87 | ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "path" ), "set_path" , "get_path" ); |
88 | ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "path_types" ), "set_path_types" , "get_path_types" ); |
89 | ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "path_rids" , PROPERTY_HINT_ARRAY_TYPE, "RID" ), "set_path_rids" , "get_path_rids" ); |
90 | ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT64_ARRAY, "path_owner_ids" ), "set_path_owner_ids" , "get_path_owner_ids" ); |
91 | |
92 | BIND_ENUM_CONSTANT(PATH_SEGMENT_TYPE_REGION); |
93 | BIND_ENUM_CONSTANT(PATH_SEGMENT_TYPE_LINK); |
94 | } |
95 | |