summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/gpu_particles_collision_3d.cpp15
-rw-r--r--scene/3d/node_3d.cpp12
2 files changed, 9 insertions, 18 deletions
diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp
index 9127168c58..6ac9364b1a 100644
--- a/scene/3d/gpu_particles_collision_3d.cpp
+++ b/scene/3d/gpu_particles_collision_3d.cpp
@@ -288,15 +288,12 @@ void GPUParticlesCollisionSDF::_find_closest_distance(const Vector3 &p_pos, cons
Vector3 nor = ba.cross(ac);
inside_d = Math::sqrt(
- (SGN(ba.cross(nor).dot(pa)) +
- SGN(cb.cross(nor).dot(pb)) +
- SGN(ac.cross(nor).dot(pc)) <
- 2.0) ?
- MIN(MIN(
- Vector3_dot2(ba * CLAMP(ba.dot(pa) / Vector3_dot2(ba), 0.0, 1.0) - pa),
- Vector3_dot2(cb * CLAMP(cb.dot(pb) / Vector3_dot2(cb), 0.0, 1.0) - pb)),
- Vector3_dot2(ac * CLAMP(ac.dot(pc) / Vector3_dot2(ac), 0.0, 1.0) - pc)) :
- nor.dot(pa) * nor.dot(pa) / Vector3_dot2(nor));
+ (SGN(ba.cross(nor).dot(pa)) + SGN(cb.cross(nor).dot(pb)) + SGN(ac.cross(nor).dot(pc)) < 2.0)
+ ? MIN(MIN(
+ Vector3_dot2(ba * CLAMP(ba.dot(pa) / Vector3_dot2(ba), 0.0, 1.0) - pa),
+ Vector3_dot2(cb * CLAMP(cb.dot(pb) / Vector3_dot2(cb), 0.0, 1.0) - pb)),
+ Vector3_dot2(ac * CLAMP(ac.dot(pc) / Vector3_dot2(ac), 0.0, 1.0) - pc))
+ : nor.dot(pa) * nor.dot(pa) / Vector3_dot2(nor));
closest_distance = MIN(closest_distance, inside_d);
}
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index 438c65f502..1265679b36 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -94,11 +94,6 @@ void Node3D::_propagate_transform_changed(Node3D *p_origin) {
return;
}
- /*
- if (data.dirty&DIRTY_GLOBAL)
- return; //already dirty
- */
-
data.children_lock++;
for (Node3D *&E : data.children) {
@@ -244,10 +239,9 @@ Quaternion Node3D::get_quaternion() const {
}
void Node3D::set_global_transform(const Transform3D &p_transform) {
- Transform3D xform =
- (data.parent && !data.top_level_active) ?
- data.parent->get_global_transform().affine_inverse() * p_transform :
- p_transform;
+ Transform3D xform = (data.parent && !data.top_level_active)
+ ? data.parent->get_global_transform().affine_inverse() * p_transform
+ : p_transform;
set_transform(xform);
}