feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "static_body_2d.h"
|
||||
|
||||
#ifndef NAVIGATION_2D_DISABLED
|
||||
#include "scene/resources/2d/capsule_shape_2d.h"
|
||||
#include "scene/resources/2d/circle_shape_2d.h"
|
||||
#include "scene/resources/2d/concave_polygon_shape_2d.h"
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
#include "scene/resources/2d/navigation_polygon.h"
|
||||
#include "scene/resources/2d/rectangle_shape_2d.h"
|
||||
#include "servers/navigation_server_2d.h"
|
||||
#endif // NAVIGATION_2D_DISABLED
|
||||
|
||||
Callable StaticBody2D::_navmesh_source_geometry_parsing_callback;
|
||||
RID StaticBody2D::_navmesh_source_geometry_parser;
|
||||
|
|
@ -89,6 +91,7 @@ void StaticBody2D::_reload_physics_characteristics() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef NAVIGATION_2D_DISABLED
|
||||
void StaticBody2D::navmesh_parse_init() {
|
||||
ERR_FAIL_NULL(NavigationServer2D::get_singleton());
|
||||
if (!_navmesh_source_geometry_parser.is_valid()) {
|
||||
|
|
@ -156,7 +159,7 @@ void StaticBody2D::navmesh_parse_source_geometry(const Ref<NavigationPolygon> &p
|
|||
const real_t capsule_radius = capsule_shape->get_radius();
|
||||
|
||||
Vector<Vector2> shape_outline;
|
||||
const real_t turn_step = Math_TAU / 12.0;
|
||||
const real_t turn_step = Math::TAU / 12.0;
|
||||
shape_outline.resize(14);
|
||||
int shape_outline_inx = 0;
|
||||
for (int i = 0; i < 12; i++) {
|
||||
|
|
@ -181,7 +184,7 @@ void StaticBody2D::navmesh_parse_source_geometry(const Ref<NavigationPolygon> &p
|
|||
int circle_edge_count = 12;
|
||||
shape_outline.resize(circle_edge_count);
|
||||
|
||||
const real_t turn_step = Math_TAU / real_t(circle_edge_count);
|
||||
const real_t turn_step = Math::TAU / real_t(circle_edge_count);
|
||||
for (int i = 0; i < circle_edge_count; i++) {
|
||||
shape_outline.write[i] = static_body_xform.xform(Vector2(Math::cos(i * turn_step), Math::sin(i * turn_step)) * circle_radius);
|
||||
}
|
||||
|
|
@ -213,6 +216,7 @@ void StaticBody2D::navmesh_parse_source_geometry(const Ref<NavigationPolygon> &p
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // NAVIGATION_2D_DISABLED
|
||||
|
||||
void StaticBody2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_constant_linear_velocity", "vel"), &StaticBody2D::set_constant_linear_velocity);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue