mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
parent
64a63e0861
commit
b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions
|
@ -38,7 +38,6 @@
|
|||
#include "thirdparty/misc/triangulator.h"
|
||||
|
||||
void CollisionPolygon2D::_build_polygon() {
|
||||
|
||||
parent->shape_owner_clear_shapes(owner_id);
|
||||
|
||||
bool solids = build_mode == BUILD_SOLIDS;
|
||||
|
@ -87,7 +86,6 @@ Vector<Vector<Vector2>> CollisionPolygon2D::_decompose_in_convex() {
|
|||
}
|
||||
|
||||
void CollisionPolygon2D::_update_in_shape_owner(bool p_xform_only) {
|
||||
|
||||
parent->shape_owner_set_transform(owner_id, get_transform());
|
||||
if (p_xform_only)
|
||||
return;
|
||||
|
@ -97,10 +95,8 @@ void CollisionPolygon2D::_update_in_shape_owner(bool p_xform_only) {
|
|||
}
|
||||
|
||||
void CollisionPolygon2D::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_PARENTED: {
|
||||
|
||||
parent = Object::cast_to<CollisionObject2D>(get_parent());
|
||||
if (parent) {
|
||||
owner_id = parent->create_shape_owner(this);
|
||||
|
@ -116,14 +112,12 @@ void CollisionPolygon2D::_notification(int p_what) {
|
|||
|
||||
} break;
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
|
||||
if (parent) {
|
||||
_update_in_shape_owner();
|
||||
}
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
|
||||
|
||||
if (parent) {
|
||||
_update_in_shape_owner(true);
|
||||
}
|
||||
|
@ -138,7 +132,6 @@ void CollisionPolygon2D::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_DRAW: {
|
||||
|
||||
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
|
||||
break;
|
||||
}
|
||||
|
@ -187,7 +180,6 @@ void CollisionPolygon2D::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void CollisionPolygon2D::set_polygon(const Vector<Point2> &p_polygon) {
|
||||
|
||||
polygon = p_polygon;
|
||||
|
||||
{
|
||||
|
@ -198,7 +190,6 @@ void CollisionPolygon2D::set_polygon(const Vector<Point2> &p_polygon) {
|
|||
aabb.expand_to(polygon[i]);
|
||||
}
|
||||
if (aabb == Rect2()) {
|
||||
|
||||
aabb = Rect2(-10, -10, 20, 20);
|
||||
} else {
|
||||
aabb.position -= aabb.size * 0.3;
|
||||
|
@ -215,12 +206,10 @@ void CollisionPolygon2D::set_polygon(const Vector<Point2> &p_polygon) {
|
|||
}
|
||||
|
||||
Vector<Point2> CollisionPolygon2D::get_polygon() const {
|
||||
|
||||
return polygon;
|
||||
}
|
||||
|
||||
void CollisionPolygon2D::set_build_mode(BuildMode p_mode) {
|
||||
|
||||
ERR_FAIL_INDEX((int)p_mode, 2);
|
||||
build_mode = p_mode;
|
||||
if (parent) {
|
||||
|
@ -232,13 +221,11 @@ void CollisionPolygon2D::set_build_mode(BuildMode p_mode) {
|
|||
}
|
||||
|
||||
CollisionPolygon2D::BuildMode CollisionPolygon2D::get_build_mode() const {
|
||||
|
||||
return build_mode;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Rect2 CollisionPolygon2D::_edit_get_rect() const {
|
||||
|
||||
return aabb;
|
||||
}
|
||||
|
||||
|
@ -247,13 +234,11 @@ bool CollisionPolygon2D::_edit_use_rect() const {
|
|||
}
|
||||
|
||||
bool CollisionPolygon2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
|
||||
|
||||
return Geometry::is_point_in_polygon(p_point, Variant(polygon));
|
||||
}
|
||||
#endif
|
||||
|
||||
String CollisionPolygon2D::get_configuration_warning() const {
|
||||
|
||||
String warning = Node2D::get_configuration_warning();
|
||||
if (!Object::cast_to<CollisionObject2D>(get_parent())) {
|
||||
if (warning != String()) {
|
||||
|
@ -309,7 +294,6 @@ void CollisionPolygon2D::set_one_way_collision(bool p_enable) {
|
|||
}
|
||||
|
||||
bool CollisionPolygon2D::is_one_way_collision_enabled() const {
|
||||
|
||||
return one_way_collision;
|
||||
}
|
||||
|
||||
|
@ -324,7 +308,6 @@ float CollisionPolygon2D::get_one_way_collision_margin() const {
|
|||
return one_way_collision_margin;
|
||||
}
|
||||
void CollisionPolygon2D::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_polygon", "polygon"), &CollisionPolygon2D::set_polygon);
|
||||
ClassDB::bind_method(D_METHOD("get_polygon"), &CollisionPolygon2D::get_polygon);
|
||||
|
||||
|
@ -348,7 +331,6 @@ void CollisionPolygon2D::_bind_methods() {
|
|||
}
|
||||
|
||||
CollisionPolygon2D::CollisionPolygon2D() {
|
||||
|
||||
aabb = Rect2(-10, -10, 20, 20);
|
||||
build_mode = BUILD_SOLIDS;
|
||||
set_notify_local_transform(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue