Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
parent
710b34b702
commit
0be6d925dc
1552 changed files with 1 additions and 33876 deletions
|
|
@ -45,20 +45,16 @@
|
|||
//TODO: Implement CylinderShape and HeightMapShape?
|
||||
|
||||
void CollisionShape3D::make_convex_from_brothers() {
|
||||
|
||||
Node *p = get_parent();
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < p->get_child_count(); i++) {
|
||||
|
||||
Node *n = p->get_child(i);
|
||||
MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(n);
|
||||
if (mi) {
|
||||
|
||||
Ref<Mesh> m = mi->get_mesh();
|
||||
if (m.is_valid()) {
|
||||
|
||||
Ref<Shape3D> s = m->create_convex_shape();
|
||||
set_shape(s);
|
||||
}
|
||||
|
|
@ -74,9 +70,7 @@ void CollisionShape3D::_update_in_shape_owner(bool p_xform_only) {
|
|||
}
|
||||
|
||||
void CollisionShape3D::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
|
||||
case NOTIFICATION_PARENTED: {
|
||||
parent = Object::cast_to<CollisionObject3D>(get_parent());
|
||||
if (parent) {
|
||||
|
|
@ -111,12 +105,10 @@ void CollisionShape3D::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void CollisionShape3D::resource_changed(RES res) {
|
||||
|
||||
update_gizmo();
|
||||
}
|
||||
|
||||
String CollisionShape3D::get_configuration_warning() const {
|
||||
|
||||
if (!Object::cast_to<CollisionObject3D>(get_parent())) {
|
||||
return TTR("CollisionShape3D only serves to provide a collision shape to a CollisionObject3D derived node. Please only use it as a child of Area3D, StaticBody3D, RigidBody3D, KinematicBody3D, etc. to give them a shape.");
|
||||
}
|
||||
|
|
@ -137,7 +129,6 @@ String CollisionShape3D::get_configuration_warning() const {
|
|||
}
|
||||
|
||||
void CollisionShape3D::_bind_methods() {
|
||||
|
||||
//not sure if this should do anything
|
||||
ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape3D::resource_changed);
|
||||
ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape3D::set_shape);
|
||||
|
|
@ -154,7 +145,6 @@ void CollisionShape3D::_bind_methods() {
|
|||
}
|
||||
|
||||
void CollisionShape3D::set_shape(const Ref<Shape3D> &p_shape) {
|
||||
|
||||
if (!shape.is_null()) {
|
||||
shape->unregister_owner(this);
|
||||
shape->disconnect("changed", callable_mp(this, &CollisionShape3D::_shape_changed));
|
||||
|
|
@ -178,12 +168,10 @@ void CollisionShape3D::set_shape(const Ref<Shape3D> &p_shape) {
|
|||
}
|
||||
|
||||
Ref<Shape3D> CollisionShape3D::get_shape() const {
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
void CollisionShape3D::set_disabled(bool p_disabled) {
|
||||
|
||||
disabled = p_disabled;
|
||||
update_gizmo();
|
||||
if (parent) {
|
||||
|
|
@ -192,12 +180,10 @@ void CollisionShape3D::set_disabled(bool p_disabled) {
|
|||
}
|
||||
|
||||
bool CollisionShape3D::is_disabled() const {
|
||||
|
||||
return disabled;
|
||||
}
|
||||
|
||||
CollisionShape3D::CollisionShape3D() {
|
||||
|
||||
//indicator = RenderingServer::get_singleton()->mesh_create();
|
||||
disabled = false;
|
||||
debug_shape = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue