diff options
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/body_2d_sw.cpp | 24 | ||||
-rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/collision_solver_2d_sat.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/collision_solver_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.cpp | 2 |
5 files changed, 15 insertions, 19 deletions
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 60bbcef4b6..5dff655ea1 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -185,28 +185,28 @@ real_t Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const { case Physics2DServer::BODY_PARAM_BOUNCE: { return bounce; - } break; + } case Physics2DServer::BODY_PARAM_FRICTION: { return friction; - } break; + } case Physics2DServer::BODY_PARAM_MASS: { return mass; - } break; + } case Physics2DServer::BODY_PARAM_INERTIA: { return _inv_inertia == 0 ? 0 : 1.0 / _inv_inertia; - } break; + } case Physics2DServer::BODY_PARAM_GRAVITY_SCALE: { return gravity_scale; - } break; + } case Physics2DServer::BODY_PARAM_LINEAR_DAMP: { return linear_damp; - } break; + } case Physics2DServer::BODY_PARAM_ANGULAR_DAMP: { return angular_damp; - } break; + } default: { } } @@ -343,19 +343,19 @@ Variant Body2DSW::get_state(Physics2DServer::BodyState p_state) const { switch (p_state) { case Physics2DServer::BODY_STATE_TRANSFORM: { return get_transform(); - } break; + } case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: { return linear_velocity; - } break; + } case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: { return angular_velocity; - } break; + } case Physics2DServer::BODY_STATE_SLEEPING: { return !is_active(); - } break; + } case Physics2DServer::BODY_STATE_CAN_SLEEP: { return can_sleep; - } break; + } } return Variant(); diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 1bbb50c974..6dd19c2868 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -673,7 +673,7 @@ public IEnumerable<Point3D> GetCellsOnRay(Ray ray, int maxDepth) // "A Fast Voxel Traversal Algorithm for Ray Tracing" // John Amanatides, Andrew Woo // http://www.cse.yorku.ca/~amana/research/grid.pdf - // http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf + // https://web.archive.org/web/20100616193049/http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf // NOTES: // * This code assumes that the ray's position and direction are in 'cell coordinates', which means diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index 9d75f71ff0..19e4b8c1d9 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -172,8 +172,8 @@ static void _generate_contacts_from_supports(const Vector2 *p_points_A, int p_po points_B = p_points_B; } - int version_A = (pointcount_A > 3 ? 3 : pointcount_A) - 1; - int version_B = (pointcount_B > 3 ? 3 : pointcount_B) - 1; + int version_A = (pointcount_A > 2 ? 2 : pointcount_A) - 1; + int version_B = (pointcount_B > 2 ? 2 : pointcount_B) - 1; GenerateContactsFunc contacts_func = generate_contacts_func_table[version_A][version_B]; ERR_FAIL_COND(!contacts_func); diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index e49961c048..03c0fd5981 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -249,6 +249,4 @@ bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A, const Transform2D &p return collision_solver(p_shape_A, p_transform_A, p_motion_A, p_shape_B, p_transform_B, p_motion_B, p_result_callback, p_userdata, false, sep_axis, margin_A, margin_B); } - - return false; } diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 71c00c0abf..c698290fd9 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -54,8 +54,6 @@ void Physics2DServerWrapMT::thread_loop() { server_thread = Thread::get_caller_id(); - OS::get_singleton()->make_rendering_thread(); - physics_2d_server->init(); exit = false; |