From a3c90b029308eb46b7fd83a0cf7b502ecbd79d55 Mon Sep 17 00:00:00 2001 From: alexholly Date: Sun, 4 Jun 2017 00:25:13 +0200 Subject: renamed all Rect2.pos to Rect2.position --- servers/physics_2d/broad_phase_2d_hash_grid.cpp | 12 ++++++------ servers/physics_2d/collision_object_2d_sw.cpp | 2 +- servers/physics_2d/collision_solver_2d_sw.cpp | 2 +- servers/physics_2d/shape_2d_sw.cpp | 16 ++++++++-------- servers/physics_2d/shape_2d_sw.h | 4 ++-- servers/physics_2d/space_2d_sw.cpp | 14 +++++++------- servers/visual/rasterizer.h | 8 ++++---- servers/visual/visual_server_canvas.cpp | 6 +++--- servers/visual/visual_server_viewport.cpp | 2 +- servers/visual_server.cpp | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) (limited to 'servers') diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index e39a5b6df1..438cd416f6 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -116,8 +116,8 @@ void BroadPhase2DHashGrid::_enter_grid(Element *p_elem, const Rect2 &p_rect, boo return; } - Point2i from = (p_rect.pos / cell_size).floor(); - Point2i to = ((p_rect.pos + p_rect.size) / cell_size).floor(); + Point2i from = (p_rect.position / cell_size).floor(); + Point2i to = ((p_rect.position + p_rect.size) / cell_size).floor(); for (int i = from.x; i <= to.x; i++) { @@ -214,8 +214,8 @@ void BroadPhase2DHashGrid::_exit_grid(Element *p_elem, const Rect2 &p_rect, bool return; } - Point2i from = (p_rect.pos / cell_size).floor(); - Point2i to = ((p_rect.pos + p_rect.size) / cell_size).floor(); + Point2i from = (p_rect.position / cell_size).floor(); + Point2i to = ((p_rect.position + p_rect.size) / cell_size).floor(); for (int i = from.x; i <= to.x; i++) { @@ -574,8 +574,8 @@ int BroadPhase2DHashGrid::cull_aabb(const Rect2 &p_aabb, CollisionObject2DSW **p pass++; - Point2i from = (p_aabb.pos / cell_size).floor(); - Point2i to = ((p_aabb.pos + p_aabb.size) / cell_size).floor(); + Point2i from = (p_aabb.position / cell_size).floor(); + Point2i to = ((p_aabb.position + p_aabb.size) / cell_size).floor(); int cullcount = 0; for (int i = from.x; i <= to.x; i++) { diff --git a/servers/physics_2d/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp index 265b5bb836..b6c1d145df 100644 --- a/servers/physics_2d/collision_object_2d_sw.cpp +++ b/servers/physics_2d/collision_object_2d_sw.cpp @@ -169,7 +169,7 @@ void CollisionObject2DSW::_update_shapes_with_motion(const Vector2 &p_motion) { Rect2 shape_aabb = s.shape->get_aabb(); Transform2D xform = transform * s.xform; shape_aabb = xform.xform(shape_aabb); - shape_aabb = shape_aabb.merge(Rect2(shape_aabb.pos + p_motion, shape_aabb.size)); //use motion + shape_aabb = shape_aabb.merge(Rect2(shape_aabb.position + p_motion, shape_aabb.size)); //use motion s.aabb_cache = shape_aabb; space->get_broadphase()->move(s.bpid, shape_aabb); diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index e57d1b7044..b482f826c2 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -203,7 +203,7 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A, const Transf smin *= axis_scale; smax *= axis_scale; - local_aabb.pos[i] = smin; + local_aabb.position[i] = smin; local_aabb.size[i] = smax - smin; } diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 203a1052b2..245b4e15bc 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -246,12 +246,12 @@ void SegmentShape2DSW::set_data(const Variant &p_data) { ERR_FAIL_COND(p_data.get_type() != Variant::RECT2); Rect2 r = p_data; - a = r.pos; + a = r.position; b = r.size; n = (b - a).tangent(); Rect2 aabb; - aabb.pos = a; + aabb.position = a; aabb.expand_to(b); if (aabb.size.x == 0) aabb.size.x = 0.001; @@ -263,7 +263,7 @@ void SegmentShape2DSW::set_data(const Variant &p_data) { Variant SegmentShape2DSW::get_data() const { Rect2 r; - r.pos = a; + r.position = a; r.size = b; return r; } @@ -621,13 +621,13 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Vec real_t ConvexPolygonShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { Rect2 aabb; - aabb.pos = points[0].pos * p_scale; + aabb.position = points[0].pos * p_scale; for (int i = 0; i < point_count; i++) { aabb.expand_to(points[i].pos * p_scale); } - return p_mass * aabb.size.dot(aabb.size) / 12.0 + p_mass * (aabb.pos + aabb.size * 0.5).length_squared(); + return p_mass * aabb.size.dot(aabb.size) / 12.0 + p_mass * (aabb.position + aabb.size * 0.5).length_squared(); } void ConvexPolygonShape2DSW::set_data(const Variant &p_data) { @@ -677,7 +677,7 @@ void ConvexPolygonShape2DSW::set_data(const Variant &p_data) { ERR_FAIL_COND(point_count == 0); Rect2 aabb; - aabb.pos = points[0].pos; + aabb.position = points[0].pos; for (int i = 1; i < point_count; i++) aabb.expand_to(points[i].pos); @@ -942,7 +942,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant &p_data) { } points.resize(pointmap.size()); - aabb.pos = pointmap.front()->key(); + aabb.position = pointmap.front()->key(); for (Map::Element *E = pointmap.front(); E; E = E->next()) { aabb.expand_to(E->key()); @@ -953,7 +953,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant &p_data) { main_vbh.resize(segments.size()); for (int i = 0; i < main_vbh.size(); i++) { - main_vbh[i].aabb.pos = points[segments[i].points[0]]; + main_vbh[i].aabb.position = points[segments[i].points[0]]; main_vbh[i].aabb.expand_to(points[segments[i].points[1]]); main_vbh[i].left = -1; main_vbh[i].right = i; diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index 547ecdcd11..4cc98b7f1e 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -513,7 +513,7 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW { _FORCE_INLINE_ bool operator()(const BVH &a, const BVH &b) const { - return (a.aabb.pos.x + a.aabb.size.x * 0.5) < (b.aabb.pos.x + b.aabb.size.x * 0.5); + return (a.aabb.position.x + a.aabb.size.x * 0.5) < (b.aabb.position.x + b.aabb.size.x * 0.5); } }; @@ -521,7 +521,7 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW { _FORCE_INLINE_ bool operator()(const BVH &a, const BVH &b) const { - return (a.aabb.pos.y + a.aabb.size.y * 0.5) < (b.aabb.pos.y + b.aabb.size.y * 0.5); + return (a.aabb.position.y + a.aabb.size.y * 0.5) < (b.aabb.position.y + b.aabb.size.y * 0.5); } }; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index ac479aab7a..78b1e84734 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -50,7 +50,7 @@ int Physics2DDirectSpaceStateSW::intersect_point(const Vector2 &p_point, ShapeRe return 0; Rect2 aabb; - aabb.pos = p_point - Vector2(0.00001, 0.00001); + aabb.position = p_point - Vector2(0.00001, 0.00001); aabb.size = Vector2(0.00002, 0.00002); int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results); @@ -223,7 +223,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor ERR_FAIL_COND_V(!shape, false); Rect2 aabb = p_xform.xform(shape->get_aabb()); - aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion + aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion aabb = aabb.grow(p_margin); /* @@ -339,7 +339,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D & ERR_FAIL_COND_V(!shape, 0); Rect2 aabb = p_shape_xform.xform(shape->get_aabb()); - aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion + aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion aabb = aabb.grow(p_margin); int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results); @@ -434,7 +434,7 @@ bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_sh ERR_FAIL_COND_V(!shape, 0); Rect2 aabb = p_shape_xform.xform(shape->get_aabb()); - aabb = aabb.merge(Rect2(aabb.pos + p_motion, aabb.size)); //motion + aabb = aabb.merge(Rect2(aabb.position + p_motion, aabb.size)); //motion aabb = aabb.grow(p_margin); int amount = space->broadphase->cull_aabb(aabb, space->intersection_query_results, Space2DSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results); @@ -656,7 +656,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co } body_transform.elements[2] += recover_motion; - body_aabb.pos += recover_motion; + body_aabb.position += recover_motion; recover_attempts--; @@ -671,7 +671,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co // STEP 2 ATTEMPT MOTION Rect2 motion_aabb = body_aabb; - motion_aabb.pos += p_motion; + motion_aabb.position += p_motion; motion_aabb = motion_aabb.merge(body_aabb); int amount = _cull_aabb_for_body(p_body, motion_aabb); @@ -807,7 +807,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co Transform2D body_shape_xform = ugt * p_body->get_shape_transform(best_shape); Shape2DSW *body_shape = p_body->get_shape(best_shape); - body_aabb.pos += p_motion * unsafe; + body_aabb.position += p_motion * unsafe; int amount = _cull_aabb_for_body(p_body, body_aabb); diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 4b274acd9e..723c5737cd 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -769,7 +769,7 @@ public: case Item::Command::TYPE_LINE: { const Item::CommandLine *line = static_cast(c); - r.pos = line->from; + r.position = line->from; r.expand_to(line->to); } break; case Item::Command::TYPE_RECT: { @@ -786,7 +786,7 @@ public: case Item::Command::TYPE_PRIMITIVE: { const Item::CommandPrimitive *primitive = static_cast(c); - r.pos = primitive->points[0]; + r.position = primitive->points[0]; for (int i = 1; i < primitive->points.size(); i++) { r.expand_to(primitive->points[i]); @@ -797,7 +797,7 @@ public: const Item::CommandPolygon *polygon = static_cast(c); int l = polygon->points.size(); const Point2 *pp = &polygon->points[0]; - r.pos = pp[0]; + r.position = pp[0]; for (int i = 1; i < l; i++) { r.expand_to(pp[i]); @@ -822,7 +822,7 @@ public: case Item::Command::TYPE_CIRCLE: { const Item::CommandCircle *circle = static_cast(c); - r.pos = Point2(-circle->radius, -circle->radius) + circle->pos; + r.position = Point2(-circle->radius, -circle->radius) + circle->pos; r.size = Point2(circle->radius * 2.0, circle->radius * 2.0); } break; case Item::Command::TYPE_TRANSFORM: { diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index 3a83ba887d..b4a133e68a 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -61,7 +61,7 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor Rect2 rect = ci->get_rect(); Transform2D xform = p_transform * ci->xform; Rect2 global_rect = xform.xform(rect); - global_rect.pos += p_clip_rect.pos; + global_rect.position += p_clip_rect.position; if (ci->use_parent_material && p_material_owner) ci->material_owner = p_material_owner; @@ -119,7 +119,7 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor ci->final_transform = xform; ci->final_modulate = Color(modulate.r * ci->self_modulate.r, modulate.g * ci->self_modulate.g, modulate.b * ci->self_modulate.b, modulate.a * ci->self_modulate.a); ci->global_rect_cache = global_rect; - ci->global_rect_cache.pos -= p_clip_rect.pos; + ci->global_rect_cache.position -= p_clip_rect.position; ci->light_masked = false; int zidx = p_z - VS::CANVAS_ITEM_Z_MIN; @@ -1041,7 +1041,7 @@ void VisualServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occlud PoolVector::Read r = p_shape.read(); for (int i = 0; i < lc; i++) { if (i == 0) - occluder_poly->aabb.pos = r[i]; + occluder_poly->aabb.position = r[i]; else occluder_poly->aabb.expand_to(r[i]); } diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 63ed0ac7c4..c1f1922255 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -133,7 +133,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) { cl->texture_cache = NULL; Transform2D scale; scale.scale(cl->rect_cache.size); - scale.elements[2] = cl->rect_cache.pos; + scale.elements[2] = cl->rect_cache.position; cl->light_shader_xform = (cl->xform_cache * scale).affine_inverse(); cl->light_shader_pos = cl->xform_cache[2]; if (cl->shadow_buffer.is_valid()) { diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 5df1ca456b..498b7dcc43 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -399,7 +399,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ } } - r_aabb = Rect3(Vector3(aabb.pos.x, aabb.pos.y, 0), Vector3(aabb.size.x, aabb.size.y, 0)); + r_aabb = Rect3(Vector3(aabb.position.x, aabb.position.y, 0), Vector3(aabb.size.x, aabb.size.y, 0)); } else { PoolVector array = p_arrays[ai]; -- cgit v1.2.3