diff options
Diffstat (limited to 'scene/3d/navigation.cpp')
| -rw-r--r-- | scene/3d/navigation.cpp | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 2b74d43ad2..9bb19880bf 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* navigation.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "navigation.h" void Navigation::_navmesh_link(int p_id) { @@ -8,12 +36,12 @@ void Navigation::_navmesh_link(int p_id) { print_line("LINK"); - DVector<Vector3> vertices=nm.navmesh->get_vertices(); + PoolVector<Vector3> vertices=nm.navmesh->get_vertices(); int len = vertices.size(); if (len==0) return; - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); for(int i=0;i<nm.navmesh->get_polygon_count();i++) { @@ -340,7 +368,7 @@ Vector<Vector3> Navigation::get_simple_path(const Vector3& p_start, const Vector while(!found_route) { if (open_list.size()==0) { - // print_line("NOU OPEN LIST"); + //print_line("NOU OPEN LIST"); break; } //check open list @@ -702,18 +730,18 @@ Vector3 Navigation::get_up_vector() const{ void Navigation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); - ObjectTypeDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); + ClassDB::bind_method(_MD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); + ClassDB::bind_method(_MD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); + ClassDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); - ObjectTypeDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); - ObjectTypeDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); - ObjectTypeDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); + ClassDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); + ClassDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); + ClassDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); + ClassDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); + ClassDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); - ObjectTypeDB::bind_method(_MD("set_up_vector","up"),&Navigation::set_up_vector); - ObjectTypeDB::bind_method(_MD("get_up_vector"),&Navigation::get_up_vector); + ClassDB::bind_method(_MD("set_up_vector","up"),&Navigation::set_up_vector); + ClassDB::bind_method(_MD("get_up_vector"),&Navigation::get_up_vector); ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"up_vector"),_SCS("set_up_vector"),_SCS("get_up_vector")); } |