diff options
| author | Thaddeus Crews <repiteo@outlook.com> | 2024-09-12 12:03:59 -0500 |
|---|---|---|
| committer | Thaddeus Crews <repiteo@outlook.com> | 2024-09-25 09:44:42 -0500 |
| commit | 32c83a228dff7a1f485ab208dff773c3fa74b133 (patch) | |
| tree | 31acc26b9cafc711478c287b1e26fe87827830a6 /modules | |
| parent | 0a9d8f04c10870c0f9f7bbd2e0505edc8494e299 (diff) | |
| download | redot-engine-32c83a228dff7a1f485ab208dff773c3fa74b133.tar.gz | |
Style: Add `WARNING:` as new comment admonition
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 7 | ||||
| -rw-r--r-- | modules/godot_physics_2d/godot_body_pair_2d.cpp | 12 | ||||
| -rw-r--r-- | modules/godot_physics_2d/godot_step_2d.cpp | 4 | ||||
| -rw-r--r-- | modules/godot_physics_3d/godot_body_pair_3d.cpp | 12 | ||||
| -rw-r--r-- | modules/godot_physics_3d/godot_step_3d.cpp | 4 |
5 files changed, 22 insertions, 17 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index eebf282633..f4f445e096 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2629,9 +2629,10 @@ Error GDScriptCompiler::_parse_setter_getter(GDScript *p_script, const GDScriptP return err; } -// Prepares given script, and inner class scripts, for compilation. It populates class members and initializes method -// RPC info for its base classes first, then for itself, then for inner classes. -// Warning: this function cannot initiate compilation of other classes, or it will result in cyclic dependency issues. +// Prepares given script, and inner class scripts, for compilation. It populates class members and +// initializes method RPC info for its base classes first, then for itself, then for inner classes. +// WARNING: This function cannot initiate compilation of other classes, or it will result in +// cyclic dependency issues. Error GDScriptCompiler::_prepare_compilation(GDScript *p_script, const GDScriptParser::ClassNode *p_class, bool p_keep_state) { if (parsed_classes.has(p_script)) { return OK; diff --git a/modules/godot_physics_2d/godot_body_pair_2d.cpp b/modules/godot_physics_2d/godot_body_pair_2d.cpp index 6c2d28dc92..98f11d6c07 100644 --- a/modules/godot_physics_2d/godot_body_pair_2d.cpp +++ b/modules/godot_physics_2d/godot_body_pair_2d.cpp @@ -161,11 +161,13 @@ void GodotBodyPair2D::_validate_contacts() { } } -// _test_ccd prevents tunneling by slowing down a high velocity body that is about to collide so that next frame it will be at an appropriate location to collide (i.e. slight overlap) -// Warning: the way velocity is adjusted down to cause a collision means the momentum will be weaker than it should for a bounce! -// Process: only proceed if body A's motion is high relative to its size. -// cast forward along motion vector to see if A is going to enter/pass B's collider next frame, only proceed if it does. -// adjust the velocity of A down so that it will just slightly intersect the collider instead of blowing right past it. +// `_test_ccd` prevents tunneling by slowing down a high velocity body that is about to collide so +// that next frame it will be at an appropriate location to collide (i.e. slight overlap). +// WARNING: The way velocity is adjusted down to cause a collision means the momentum will be +// weaker than it should for a bounce! +// Process: Only proceed if body A's motion is high relative to its size. +// Cast forward along motion vector to see if A is going to enter/pass B's collider next frame, only proceed if it does. +// Adjust the velocity of A down so that it will just slightly intersect the collider instead of blowing right past it. bool GodotBodyPair2D::_test_ccd(real_t p_step, GodotBody2D *p_A, int p_shape_A, const Transform2D &p_xform_A, GodotBody2D *p_B, int p_shape_B, const Transform2D &p_xform_B) { Vector2 motion = p_A->get_linear_velocity() * p_step; real_t mlen = motion.length(); diff --git a/modules/godot_physics_2d/godot_step_2d.cpp b/modules/godot_physics_2d/godot_step_2d.cpp index bbaec8be2b..418b9313e8 100644 --- a/modules/godot_physics_2d/godot_step_2d.cpp +++ b/modules/godot_physics_2d/godot_step_2d.cpp @@ -251,14 +251,14 @@ void GodotStep2D::step(GodotSpace2D *p_space, real_t p_delta) { /* PRE-SOLVE CONSTRAINT ISLANDS */ - // Warning: This doesn't run on threads, because it involves thread-unsafe processing. + // WARNING: This doesn't run on threads, because it involves thread-unsafe processing. for (uint32_t island_index = 0; island_index < island_count; ++island_index) { _pre_solve_island(constraint_islands[island_index]); } /* SOLVE CONSTRAINT ISLANDS */ - // Warning: _solve_island modifies the constraint islands for optimization purpose, + // WARNING: `_solve_island` modifies the constraint islands for optimization purpose, // their content is not reliable after these calls and shouldn't be used anymore. group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &GodotStep2D::_solve_island, nullptr, island_count, -1, true, SNAME("Physics2DConstraintSolveIslands")); WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); diff --git a/modules/godot_physics_3d/godot_body_pair_3d.cpp b/modules/godot_physics_3d/godot_body_pair_3d.cpp index 84fae73616..d689271ac7 100644 --- a/modules/godot_physics_3d/godot_body_pair_3d.cpp +++ b/modules/godot_physics_3d/godot_body_pair_3d.cpp @@ -161,11 +161,13 @@ void GodotBodyPair3D::validate_contacts() { } } -// _test_ccd prevents tunneling by slowing down a high velocity body that is about to collide so that next frame it will be at an appropriate location to collide (i.e. slight overlap) -// Warning: the way velocity is adjusted down to cause a collision means the momentum will be weaker than it should for a bounce! -// Process: only proceed if body A's motion is high relative to its size. -// cast forward along motion vector to see if A is going to enter/pass B's collider next frame, only proceed if it does. -// adjust the velocity of A down so that it will just slightly intersect the collider instead of blowing right past it. +// `_test_ccd` prevents tunneling by slowing down a high velocity body that is about to collide so +// that next frame it will be at an appropriate location to collide (i.e. slight overlap). +// WARNING: The way velocity is adjusted down to cause a collision means the momentum will be +// weaker than it should for a bounce! +// Process: Only proceed if body A's motion is high relative to its size. +// Cast forward along motion vector to see if A is going to enter/pass B's collider next frame, only proceed if it does. +// Adjust the velocity of A down so that it will just slightly intersect the collider instead of blowing right past it. bool GodotBodyPair3D::_test_ccd(real_t p_step, GodotBody3D *p_A, int p_shape_A, const Transform3D &p_xform_A, GodotBody3D *p_B, int p_shape_B, const Transform3D &p_xform_B) { GodotShape3D *shape_A_ptr = p_A->get_shape(p_shape_A); diff --git a/modules/godot_physics_3d/godot_step_3d.cpp b/modules/godot_physics_3d/godot_step_3d.cpp index d09a3b4e6d..b6cec4ba59 100644 --- a/modules/godot_physics_3d/godot_step_3d.cpp +++ b/modules/godot_physics_3d/godot_step_3d.cpp @@ -355,14 +355,14 @@ void GodotStep3D::step(GodotSpace3D *p_space, real_t p_delta) { /* PRE-SOLVE CONSTRAINT ISLANDS */ - // Warning: This doesn't run on threads, because it involves thread-unsafe processing. + // WARNING: This doesn't run on threads, because it involves thread-unsafe processing. for (uint32_t island_index = 0; island_index < island_count; ++island_index) { _pre_solve_island(constraint_islands[island_index]); } /* SOLVE CONSTRAINT ISLANDS */ - // Warning: _solve_island modifies the constraint islands for optimization purpose, + // WARNING: `_solve_island` modifies the constraint islands for optimization purpose, // their content is not reliable after these calls and shouldn't be used anymore. group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &GodotStep3D::_solve_island, nullptr, island_count, -1, true, SNAME("Physics3DConstraintSolveIslands")); WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); |
