diff options
Diffstat (limited to 'scene')
86 files changed, 406 insertions, 406 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 3276f3f004..6c387c610f 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -47,7 +47,7 @@ void Camera2D::_update_scroll() { ERR_FAIL_COND( custom_viewport && !ObjectDB::get_instance(custom_viewport_id) ); - Matrix32 xform = get_camera_transform(); + Transform2D xform = get_camera_transform(); if (viewport) { viewport->set_canvas_transform( xform ); @@ -71,12 +71,12 @@ Vector2 Camera2D::get_zoom() const { }; -Matrix32 Camera2D::get_camera_transform() { +Transform2D Camera2D::get_camera_transform() { if (!get_tree()) - return Matrix32(); + return Transform2D(); - ERR_FAIL_COND_V( custom_viewport && !ObjectDB::get_instance(custom_viewport_id), Matrix32() ); + ERR_FAIL_COND_V( custom_viewport && !ObjectDB::get_instance(custom_viewport_id), Transform2D() ); Size2 screen_size = viewport->get_visible_rect().size; @@ -201,7 +201,7 @@ Matrix32 Camera2D::get_camera_transform() { camera_screen_center=screen_rect.pos+screen_rect.size*0.5; - Matrix32 xform; + Transform2D xform; if(rotating){ xform.set_rotation(angle); } @@ -272,7 +272,7 @@ void Camera2D::_notification(int p_what) { if (is_current()) { if (viewport && !(custom_viewport && !ObjectDB::get_instance(custom_viewport_id))) { - viewport->set_canvas_transform( Matrix32() ); + viewport->set_canvas_transform( Transform2D() ); } } remove_from_group(group_name); @@ -290,7 +290,7 @@ void Camera2D::_notification(int p_what) { if(current) area_axis_width = 3; - Matrix32 inv_camera_transform = get_camera_transform().affine_inverse(); + Transform2D inv_camera_transform = get_camera_transform().affine_inverse(); Size2 screen_size = get_viewport_rect().size; Vector2 screen_endpoints[4]= { @@ -300,7 +300,7 @@ void Camera2D::_notification(int p_what) { inv_camera_transform.xform(Vector2(0, screen_size.height)) }; - Matrix32 inv_transform = get_global_transform().affine_inverse(); // undo global space + Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space for(int i=0;i<4;i++) { draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i+1)%4]), area_axis_color, area_axis_width); diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index da36b04924..85d90b225a 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -80,7 +80,7 @@ protected: void _set_old_smoothing(float p_enable); protected: - virtual Matrix32 get_camera_transform(); + virtual Transform2D get_camera_transform(); void _notification(int p_what); static void _bind_methods(); public: diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index d42743afc2..b7d9ba7860 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -325,10 +325,10 @@ void CanvasItem::_update_callback() { pending_update=false; // don't change to false until finished drawing (avoid recursive update) } -Matrix32 CanvasItem::get_global_transform_with_canvas() const { +Transform2D CanvasItem::get_global_transform_with_canvas() const { const CanvasItem *ci = this; - Matrix32 xform; + Transform2D xform; const CanvasItem *last_valid=NULL; while(ci) { @@ -346,7 +346,7 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const { return xform; } -Matrix32 CanvasItem::get_global_transform() const { +Transform2D CanvasItem::get_global_transform() const { if (global_invalid) { @@ -691,12 +691,12 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S ERR_FAIL(); } - Matrix32 xform(p_rot,p_offset); + Transform2D xform(p_rot,p_offset); xform.scale_basis(p_scale); VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform); } -void CanvasItem::draw_set_transform_matrix(const Matrix32& p_matrix) { +void CanvasItem::draw_set_transform_matrix(const Transform2D& p_matrix) { if (!drawing) { ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -892,7 +892,7 @@ Vector2 CanvasItem::make_canvas_pos_local(const Vector2& screen_point) const { ERR_FAIL_COND_V(!is_inside_tree(),screen_point); - Matrix32 local_matrix = (get_canvas_transform() * + Transform2D local_matrix = (get_canvas_transform() * get_global_transform()).affine_inverse(); return local_matrix.xform(screen_point); @@ -972,8 +972,8 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); ClassDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); ClassDB::bind_method(_MD("draw_primitive","points","colors","uvs","texture:Texture","width"),&CanvasItem::draw_primitive,DEFVAL(Variant()),DEFVAL(1.0)); - ClassDB::bind_method(_MD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(Vector2Array()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(Vector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(_MD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(_MD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); ClassDB::bind_method(_MD("draw_string","font:Font","pos","text","modulate","clip_w"),&CanvasItem::draw_string,DEFVAL(Color(1,1,1)),DEFVAL(-1)); ClassDB::bind_method(_MD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1))); @@ -1041,9 +1041,9 @@ void CanvasItem::_bind_methods() { } -Matrix32 CanvasItem::get_canvas_transform() const { +Transform2D CanvasItem::get_canvas_transform() const { - ERR_FAIL_COND_V(!is_inside_tree(),Matrix32()); + ERR_FAIL_COND_V(!is_inside_tree(),Transform2D()); if (canvas_layer) return canvas_layer->get_transform(); @@ -1054,9 +1054,9 @@ Matrix32 CanvasItem::get_canvas_transform() const { } -Matrix32 CanvasItem::get_viewport_transform() const { +Transform2D CanvasItem::get_viewport_transform() const { - ERR_FAIL_COND_V(!is_inside_tree(),Matrix32()); + ERR_FAIL_COND_V(!is_inside_tree(),Transform2D()); if (canvas_layer) { diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index d0dd5be5a3..fded547275 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -120,7 +120,7 @@ private: Ref<CanvasItemMaterial> material; - mutable Matrix32 global_transform; + mutable Transform2D global_transform; mutable bool global_invalid; @@ -207,7 +207,7 @@ public: float draw_char(const Ref<Font>& p_font,const Point2& p_pos, const String& p_char,const String& p_next="",const Color& p_modulate=Color(1,1,1)); void draw_set_transform(const Point2& p_offset, float p_rot, const Size2& p_scale); - void draw_set_transform_matrix(const Matrix32& p_matrix); + void draw_set_transform_matrix(const Transform2D& p_matrix); /* RECT / TRANSFORM */ @@ -220,10 +220,10 @@ public: CanvasItem *get_parent_item() const; virtual Rect2 get_item_rect() const=0; - virtual Matrix32 get_transform() const=0; + virtual Transform2D get_transform() const=0; - virtual Matrix32 get_global_transform() const; - virtual Matrix32 get_global_transform_with_canvas() const; + virtual Transform2D get_global_transform() const; + virtual Transform2D get_global_transform_with_canvas() const; Rect2 get_item_and_children_rect() const; @@ -234,8 +234,8 @@ public: bool is_block_transform_notify_enabled() const; - Matrix32 get_canvas_transform() const; - Matrix32 get_viewport_transform() const; + Transform2D get_canvas_transform() const; + Transform2D get_viewport_transform() const; Rect2 get_viewport_rect() const; RID get_viewport_rid() const; RID get_canvas() const; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 90ca59d780..817651f57c 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -221,7 +221,7 @@ void CollisionObject2D::_update_pickable() { void CollisionObject2D::_bind_methods() { - ClassDB::bind_method(_MD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Matrix32())); + ClassDB::bind_method(_MD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Transform2D())); ClassDB::bind_method(_MD("get_shape_count"),&CollisionObject2D::get_shape_count); ClassDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject2D::set_shape); ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject2D::set_shape_transform); @@ -249,7 +249,7 @@ void CollisionObject2D::_bind_methods() { } -void CollisionObject2D::add_shape(const Ref<Shape2D>& p_shape, const Matrix32& p_transform) { +void CollisionObject2D::add_shape(const Ref<Shape2D>& p_shape, const Transform2D& p_transform) { ERR_FAIL_COND(p_shape.is_null()); @@ -285,7 +285,7 @@ void CollisionObject2D::set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape) // _update_shapes(); } -void CollisionObject2D::set_shape_transform(int p_shape_idx, const Matrix32& p_transform) { +void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& p_transform) { ERR_FAIL_INDEX(p_shape_idx,shapes.size()); shapes[p_shape_idx].xform=p_transform; @@ -304,9 +304,9 @@ Ref<Shape2D> CollisionObject2D::get_shape(int p_shape_idx) const { return shapes[p_shape_idx].shape; } -Matrix32 CollisionObject2D::get_shape_transform(int p_shape_idx) const { +Transform2D CollisionObject2D::get_shape_transform(int p_shape_idx) const { - ERR_FAIL_INDEX_V(p_shape_idx,shapes.size(),Matrix32()); + ERR_FAIL_INDEX_V(p_shape_idx,shapes.size(),Transform2D()); return shapes[p_shape_idx].xform; } diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 6f6d3520da..429b4fafe6 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -41,7 +41,7 @@ class CollisionObject2D : public Node2D { bool pickable; struct ShapeData { - Matrix32 xform; + Transform2D xform; Ref<Shape2D> shape; bool trigger; @@ -78,12 +78,12 @@ public: - void add_shape(const Ref<Shape2D>& p_shape, const Matrix32& p_transform=Matrix32()); + void add_shape(const Ref<Shape2D>& p_shape, const Transform2D& p_transform=Transform2D()); int get_shape_count() const; void set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape); - void set_shape_transform(int p_shape_idx, const Matrix32& p_transform); + void set_shape_transform(int p_shape_idx, const Transform2D& p_transform); Ref<Shape2D> get_shape(int p_shape_idx) const; - Matrix32 get_shape_transform(int p_shape_idx) const; + Transform2D get_shape_transform(int p_shape_idx) const; void set_shape_as_trigger(int p_shape_idx, bool p_trigger); bool is_shape_set_as_trigger(int p_shape_idx) const; void remove_shape(int p_shape_idx); diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 46baa7c184..04f096f229 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -330,7 +330,7 @@ void CollisionPolygon2D::_bind_methods() { ClassDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon2D::get_collision_object_last_shape); ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Segments"),_SCS("set_build_mode"),_SCS("get_build_mode")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 0d83509f37..987672df38 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -283,7 +283,7 @@ RID GrooveJoint2D::_configure_joint(){ else Physics2DServer::get_singleton()->body_remove_collision_exception(body_a->get_rid(),body_b->get_rid()); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 groove_A1 = gt.get_origin(); Vector2 groove_A2 = gt.xform( Vector2(0,length) ); Vector2 anchor_B = gt.xform( Vector2(0,initial_offset) ); @@ -384,7 +384,7 @@ RID DampedSpringJoint2D::_configure_joint(){ else Physics2DServer::get_singleton()->body_remove_collision_exception(body_a->get_rid(),body_b->get_rid()); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 anchor_A = gt.get_origin(); Vector2 anchor_B = gt.xform( Vector2(0,length) ); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index b7b280d902..8d447c3e8b 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -89,7 +89,7 @@ void OccluderPolygon2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL,"closed"),_SCS("set_closed"),_SCS("is_closed")); ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mode",PROPERTY_HINT_ENUM,"Disabled,ClockWise,CounterClockWise"),_SCS("set_cull_mode"),_SCS("get_cull_mode")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); BIND_CONSTANT(CULL_DISABLED); BIND_CONSTANT(CULL_CLOCKWISE); diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index be68c61bd8..2d0fbf1cfc 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -212,7 +212,7 @@ void Navigation2D::_navpoly_unlink(int p_id) { } -int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Matrix32& p_xform, Object *p_owner) { +int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Transform2D& p_xform, Object *p_owner) { int id = last_id++; NavMesh nm; @@ -227,7 +227,7 @@ int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Mat return id; } -void Navigation2D::navpoly_set_transform(int p_id, const Matrix32& p_xform){ +void Navigation2D::navpoly_set_transform(int p_id, const Transform2D& p_xform){ ERR_FAIL_COND(!navpoly_map.has(p_id)); NavMesh &nm=navpoly_map[p_id]; diff --git a/scene/2d/navigation2d.h b/scene/2d/navigation2d.h index c1c1600291..63827ebb6d 100644 --- a/scene/2d/navigation2d.h +++ b/scene/2d/navigation2d.h @@ -119,7 +119,7 @@ class Navigation2D : public Node2D { struct NavMesh { Object *owner; - Matrix32 xform; + Transform2D xform; bool linked; Ref<NavigationPolygon> navpoly; List<Polygon> polygons; @@ -164,8 +164,8 @@ protected: public: //API should be as dynamic as possible - int navpoly_create(const Ref<NavigationPolygon>& p_mesh,const Matrix32& p_xform,Object* p_owner=NULL); - void navpoly_set_transform(int p_id, const Matrix32& p_xform); + int navpoly_create(const Ref<NavigationPolygon>& p_mesh,const Transform2D& p_xform,Object* p_owner=NULL); + void navpoly_set_transform(int p_id, const Transform2D& p_xform); void navpoly_remove(int p_id); Vector<Vector2> get_simple_path(const Vector2& p_start, const Vector2& p_end,bool p_optimize=true); diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index add3a183ef..5c1837ad65 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -270,7 +270,7 @@ void NavigationPolygon::_bind_methods() { ClassDB::bind_method(_MD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines); ClassDB::bind_method(_MD("_get_outlines"),&NavigationPolygon::_get_outlines); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_outlines"),_SCS("_get_outlines")); } diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 800435d4c3..fb71a5b536 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -92,7 +92,7 @@ void Node2D::edit_set_rect(const Rect2& p_edit_rect) { Point2 new_pos = p_edit_rect.pos + p_edit_rect.size*zero_offset;//p_edit_rect.pos - r.pos; - Matrix32 postxf; + Transform2D postxf; postxf.set_rotation_and_scale(angle,_scale); new_pos = postxf.xform(new_pos); @@ -124,7 +124,7 @@ void Node2D::_update_xform_values() { void Node2D::_update_transform() { - Matrix32 mat(angle,pos); + Transform2D mat(angle,pos); _mat.set_rotation_and_scale(angle,_scale); _mat.elements[2]=pos; @@ -222,7 +222,7 @@ void Node2D::_notification(int p_what) { } } -Matrix32 Node2D::get_transform() const { +Transform2D Node2D::get_transform() const { return _mat; } @@ -261,7 +261,7 @@ void Node2D::scale(const Size2& p_amount) { void Node2D::move_x(float p_delta,bool p_scaled){ - Matrix32 t = get_transform(); + Transform2D t = get_transform(); Vector2 m = t[0]; if (!p_scaled) m.normalize(); @@ -270,7 +270,7 @@ void Node2D::move_x(float p_delta,bool p_scaled){ void Node2D::move_y(float p_delta,bool p_scaled){ - Matrix32 t = get_transform(); + Transform2D t = get_transform(); Vector2 m = t[1]; if (!p_scaled) m.normalize(); @@ -285,7 +285,7 @@ Point2 Node2D::get_global_position() const { void Node2D::set_global_position(const Point2& p_pos) { - Matrix32 inv; + Transform2D inv; CanvasItem *pi = get_parent_item(); if (pi) { inv = pi->get_global_transform().affine_inverse(); @@ -342,7 +342,7 @@ void Node2D::set_global_scale(const Size2& p_scale) { } -void Node2D::set_transform(const Matrix32& p_transform) { +void Node2D::set_transform(const Transform2D& p_transform) { _mat=p_transform; _xform_dirty=true; @@ -355,7 +355,7 @@ void Node2D::set_transform(const Matrix32& p_transform) { _notify_transform(); } -void Node2D::set_global_transform(const Matrix32& p_transform) { +void Node2D::set_global_transform(const Transform2D& p_transform) { CanvasItem *pi = get_parent_item(); if (pi) @@ -394,14 +394,14 @@ int Node2D::get_z() const{ return z; } -Matrix32 Node2D::get_relative_transform_to_parent(const Node *p_parent) const { +Transform2D Node2D::get_relative_transform_to_parent(const Node *p_parent) const { if (p_parent==this) - return Matrix32(); + return Transform2D(); Node2D *parent_2d = get_parent()->cast_to<Node2D>(); - ERR_FAIL_COND_V(!parent_2d,Matrix32()); + ERR_FAIL_COND_V(!parent_2d,Transform2D()); if (p_parent==parent_2d) return get_transform(); else @@ -473,13 +473,13 @@ void Node2D::_bind_methods() { ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_rotation"),_SCS("get_rotation")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation_deg",PROPERTY_HINT_RANGE,"-1440,1440,0.1",PROPERTY_USAGE_EDITOR),_SCS("set_rotation_in_degrees"),_SCS("get_rotation_in_degrees")); ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"scale"),_SCS("set_scale"),_SCS("get_scale")); - ADD_PROPERTY(PropertyInfo(Variant::MATRIX32,"transform",PROPERTY_HINT_NONE,"",0),_SCS("set_transform"),_SCS("get_transform")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"transform",PROPERTY_HINT_NONE,"",0),_SCS("set_transform"),_SCS("get_transform")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_position",PROPERTY_HINT_NONE,"",0),_SCS("set_global_position"),_SCS("get_global_position")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation"),_SCS("get_global_rotation")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation_deg",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation_in_degrees"),_SCS("get_global_rotation_in_degrees")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_scale",PROPERTY_HINT_NONE,"",0),_SCS("set_global_scale"),_SCS("get_global_scale")); - ADD_PROPERTY(PropertyInfo(Variant::MATRIX32,"global_transform",PROPERTY_HINT_NONE,"",0),_SCS("set_global_transform"),_SCS("get_global_transform")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"global_transform",PROPERTY_HINT_NONE,"",0),_SCS("set_global_transform"),_SCS("get_global_transform")); ADD_GROUP("Z",""); ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"z",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z"),_SCS("get_z")); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 15dfd703fe..2cceef0f06 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -41,7 +41,7 @@ class Node2D : public CanvasItem { int z; bool z_relative; - Matrix32 _mat; + Transform2D _mat; bool _xform_dirty; @@ -92,8 +92,8 @@ public: Size2 get_global_scale() const; virtual Rect2 get_item_rect() const; - void set_transform(const Matrix32& p_transform); - void set_global_transform(const Matrix32& p_transform); + void set_transform(const Transform2D& p_transform); + void set_global_transform(const Transform2D& p_transform); void set_global_position(const Point2& p_pos); void set_global_rotation(float p_radians); void set_global_rotation_in_degrees(float p_degrees); @@ -108,9 +108,9 @@ public: void set_z_as_relative(bool p_enabled); bool is_z_relative() const; - Matrix32 get_relative_transform_to_parent(const Node *p_parent) const; + Transform2D get_relative_transform_to_parent(const Node *p_parent) const; - Matrix32 get_transform() const; + Transform2D get_transform() const; Node2D(); }; diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 022e31760b..1e6a449fce 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -50,7 +50,7 @@ void ParallaxBackground::_notification(int p_what) { } -void ParallaxBackground::_camera_moved(const Matrix32& p_transform) { +void ParallaxBackground::_camera_moved(const Transform2D& p_transform) { set_scroll_offset(p_transform.get_origin()); diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h index 9eafc07fd6..caef4962e8 100644 --- a/scene/2d/parallax_background.h +++ b/scene/2d/parallax_background.h @@ -50,7 +50,7 @@ class ParallaxBackground : public CanvasLayer { void _update_scroll(); protected: - void _camera_moved(const Matrix32& p_transform); + void _camera_moved(const Transform2D& p_transform); void _notification(int p_what); static void _bind_methods(); diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index f8747d54b7..cb866165ff 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -270,7 +270,7 @@ void Particles2D::_process_particles(float p_delta) { Particle *pdata=&particles[0]; int particle_count=particles.size(); - Matrix32 xform; + Transform2D xform; if (!local_space) xform=get_global_transform(); @@ -293,7 +293,7 @@ void Particles2D::_process_particles(float p_delta) { } int idx=0; - Matrix32 m; + Transform2D m; if (local_space) { m= get_global_transform().affine_inverse(); } @@ -391,7 +391,7 @@ void Particles2D::_process_particles(float p_delta) { float orbitvel = (param[PARAM_ORBIT_VELOCITY]+param[PARAM_ORBIT_VELOCITY]*randomness[PARAM_ORBIT_VELOCITY]*_rand_from_seed(&rand_seed)); if (orbitvel!=0) { Vector2 rel = p.pos - xform.elements[2]; - Matrix32 rot(orbitvel*frame_time,Vector2()); + Transform2D rot(orbitvel*frame_time,Vector2()); p.pos = rot.xform(rel) + xform.elements[2]; } @@ -507,7 +507,7 @@ void Particles2D::_notification(int p_what) { if (texture.is_valid()) texrid = texture->get_rid(); - Matrix32 invxform; + Transform2D invxform; if (!local_space) invxform=get_global_transform().affine_inverse(); @@ -573,7 +573,7 @@ void Particles2D::_notification(int p_what) { //Rect2 r = Rect2(Vecto,rectsize); - Matrix32 xform; + Transform2D xform; if (p.rot) { @@ -1125,7 +1125,7 @@ void Particles2D::_bind_methods() { ADD_PROPERTYNO(PropertyInfo(Variant::COLOR, "color/color"),_SCS("set_color"),_SCS("get_color")); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"color/color_ramp",PROPERTY_HINT_RESOURCE_TYPE,"ColorRamp"),_SCS("set_color_ramp"),_SCS("get_color_ramp")); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points")); + ADD_PROPERTYNZ(PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points")); BIND_CONSTANT( PARAM_DIRECTION ); BIND_CONSTANT( PARAM_SPREAD ); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 6be5689f1d..0c2aa002c4 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -226,7 +226,7 @@ void StaticBody2D::_update_xform() { setting=true; - Matrix32 new_xform = get_global_transform(); //obtain the new one + Transform2D new_xform = get_global_transform(); //obtain the new one set_block_transform_notify(true); Physics2DServer::get_singleton()->body_set_state(get_rid(),Physics2DServer::BODY_STATE_TRANSFORM,*pre_xform); //then simulate motion! @@ -1046,7 +1046,7 @@ Variant KinematicBody2D::_get_collider() const { void KinematicBody2D::revert_motion() { - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]-=travel; travel=Vector2(); set_global_transform(gt); @@ -1062,7 +1062,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { #if 1 - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Physics2DServer::MotionResult result; colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(),gt,p_motion,margin,&result); @@ -1152,7 +1152,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]+=recover_motion; set_global_transform(gt); @@ -1203,7 +1203,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { } else { //it collided, let's get the rest info in unsafe advance - Matrix32 ugt = get_global_transform(); + Transform2D ugt = get_global_transform(); ugt.elements[2]+=p_motion*unsafe; Physics2DDirectSpaceState::ShapeRestInfo rest_info; bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt*get_shape_transform(best_shape), Vector2(), margin,&rest_info,exclude,get_layer_mask(),mask); @@ -1227,7 +1227,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { } Vector2 motion=p_motion*safe; - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]+=motion; set_global_transform(gt); @@ -1318,7 +1318,7 @@ Vector2 KinematicBody2D::move_to(const Vector2& p_position) { return move(p_position-get_global_position()); } -bool KinematicBody2D::test_move(const Matrix32& p_from,const Vector2& p_motion) { +bool KinematicBody2D::test_move(const Transform2D& p_from,const Vector2& p_motion) { ERR_FAIL_COND_V(!is_inside_tree(),false); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 240def543d..2637238c04 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -319,7 +319,7 @@ public: Vector2 move(const Vector2& p_motion); Vector2 move_to(const Vector2& p_position); - bool test_move(const Matrix32 &p_from, const Vector2& p_motion); + bool test_move(const Transform2D &p_from, const Vector2& p_motion); bool is_colliding() const; Vector2 get_travel() const; diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 948c8b0818..30e22a8437 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -148,7 +148,7 @@ void Polygon2D::_notification(int p_what) { if (texture.is_valid()) { - Matrix32 texmat(tex_rot,tex_ofs); + Transform2D texmat(tex_rot,tex_ofs); texmat.scale(tex_scale); Size2 tex_size=Vector2(1,1); @@ -372,10 +372,10 @@ void Polygon2D::_bind_methods() { - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"uv"),_SCS("set_uv"),_SCS("get_uv")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"uv"),_SCS("set_uv"),_SCS("get_uv")); ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR_ARRAY,"vertex_colors"),_SCS("set_vertex_colors"),_SCS("get_vertex_colors")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_COLOR_ARRAY,"vertex_colors"),_SCS("set_vertex_colors"),_SCS("get_vertex_colors")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset")); ADD_GROUP("Texture",""); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 572575e4ec..14dfc10d9f 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -161,7 +161,7 @@ void RayCast2D::_notification(int p_what) { if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) break; - Matrix32 xf; + Transform2D xf; xf.rotate(cast_to.angle()); xf.translate(Vector2(0,cast_to.length())); @@ -201,7 +201,7 @@ void RayCast2D::_update_raycast_state() { Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(w2d->get_space()); ERR_FAIL_COND( !dss ); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 to = cast_to; if (to==Vector2()) diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index dbbc261b48..7bd3a5d932 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -114,16 +114,16 @@ void TileMap::_update_quadrant_transform() { if (!is_inside_tree()) return; - Matrix32 global_transform = get_global_transform(); + Transform2D global_transform = get_global_transform(); - Matrix32 nav_rel; + Transform2D nav_rel; if (navigation) nav_rel = get_relative_transform_to_parent(navigation); for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { Quadrant &q=E->get(); - Matrix32 xform; + Transform2D xform; xform.set_origin( q.pos ); xform = global_transform * xform; Physics2DServer::get_singleton()->body_set_state(q.body,Physics2DServer::BODY_STATE_TRANSFORM,xform); @@ -218,7 +218,7 @@ bool TileMap::get_center_y() const { return center_y; } -void TileMap::_fix_cell_transform(Matrix32& xform,const Cell& p_cell, const Vector2& p_offset, const Size2 &p_sc) { +void TileMap::_fix_cell_transform(Transform2D& xform,const Cell& p_cell, const Vector2& p_offset, const Size2 &p_sc) { Size2 s=p_sc; Vector2 offset = p_offset; @@ -277,7 +277,7 @@ void TileMap::_update_dirty_quadrants() { Physics2DServer *ps = Physics2DServer::get_singleton(); Vector2 tofs = get_cell_draw_offset(); Vector2 tcenter = cell_size/2; - Matrix32 nav_rel; + Transform2D nav_rel; if (navigation) nav_rel = get_relative_transform_to_parent(navigation); @@ -348,7 +348,7 @@ void TileMap::_update_dirty_quadrants() { if (mat.is_valid()) vs->canvas_item_set_material(canvas_item,mat->get_rid()); vs->canvas_item_set_parent( canvas_item, get_canvas_item() ); - Matrix32 xform; + Transform2D xform; xform.set_origin( q.pos ); vs->canvas_item_set_transform( canvas_item, xform ); vs->canvas_item_set_light_mask(canvas_item,get_light_mask()); @@ -472,7 +472,7 @@ void TileMap::_update_dirty_quadrants() { if (shape.is_valid()) { Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()); _fix_cell_transform(xform,c,shape_ofs+center_ofs,s); @@ -489,14 +489,14 @@ void TileMap::_update_dirty_quadrants() { } if (debug_canvas_item.is_valid()) { - vs->canvas_item_add_set_transform(debug_canvas_item,Matrix32()); + vs->canvas_item_add_set_transform(debug_canvas_item,Transform2D()); } if (navigation) { Ref<NavigationPolygon> navpoly = tile_set->tile_get_navigation_polygon(c.id); if (navpoly.is_valid()) { Vector2 npoly_ofs = tile_set->tile_get_navigation_polygon_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()+q.pos); _fix_cell_transform(xform,c,npoly_ofs+center_ofs,s); @@ -515,7 +515,7 @@ void TileMap::_update_dirty_quadrants() { if (occluder.is_valid()) { Vector2 occluder_ofs = tile_set->tile_get_occluder_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()+q.pos); _fix_cell_transform(xform,c,occluder_ofs+center_ofs,s); @@ -598,7 +598,7 @@ void TileMap::_recompute_rect_cache() { Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const PosKey& p_qk) { - Matrix32 xform; + Transform2D xform; //xform.set_origin(Point2(p_qk.x,p_qk.y)*cell_size*quadrant_size); Quadrant q; q.pos = _map_to_world(p_qk.x*_get_quadrant_size(),p_qk.y*_get_quadrant_size()); @@ -1034,13 +1034,13 @@ TileMap::HalfOffset TileMap::get_half_offset() const { return half_offset; } -Matrix32 TileMap::get_cell_transform() const { +Transform2D TileMap::get_cell_transform() const { switch(mode) { case MODE_SQUARE: { - Matrix32 m; + Transform2D m; m[0]*=cell_size.x; m[1]*=cell_size.y; return m; @@ -1049,7 +1049,7 @@ Matrix32 TileMap::get_cell_transform() const { //isometric only makes sense when y is positive in both x and y vectors, otherwise //the drawing of tiles will overlap - Matrix32 m; + Transform2D m; m[0]=Vector2(cell_size.x*0.5,cell_size.y*0.5); m[1]=Vector2(-cell_size.x*0.5,cell_size.y*0.5); return m; @@ -1061,10 +1061,10 @@ Matrix32 TileMap::get_cell_transform() const { } break; } - return Matrix32(); + return Transform2D(); } -void TileMap::set_custom_transform(const Matrix32& p_xform) { +void TileMap::set_custom_transform(const Transform2D& p_xform) { _clear_quadrants(); custom_transform=p_xform; @@ -1073,7 +1073,7 @@ void TileMap::set_custom_transform(const Matrix32& p_xform) { } -Matrix32 TileMap::get_custom_transform() const{ +Transform2D TileMap::get_custom_transform() const{ return custom_transform; } @@ -1265,7 +1265,7 @@ void TileMap::_bind_methods() { ADD_GROUP("Cell","cell_"); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1"),_SCS("set_cell_size"),_SCS("get_cell_size")); ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),_SCS("set_quadrant_size"),_SCS("get_quadrant_size")); - ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"cell_custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform")); + ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM2D,"cell_custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform")); ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),_SCS("set_half_offset"),_SCS("get_half_offset")); ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_tile_origin",PROPERTY_HINT_ENUM,"Top Left,Center,Bottom Left"),_SCS("set_tile_origin"),_SCS("get_tile_origin")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"cell_y_sort"),_SCS("set_y_sort_mode"),_SCS("is_y_sort_mode_enabled")); diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index f863c0b2ea..ba6de62f8e 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -66,7 +66,7 @@ private: int quadrant_size; bool center_x,center_y; Mode mode; - Matrix32 custom_transform; + Transform2D custom_transform; HalfOffset half_offset; bool use_kinematic; Navigation2D *navigation; @@ -114,12 +114,12 @@ private: struct NavPoly { int id; - Matrix32 xform; + Transform2D xform; }; struct Occluder { RID id; - Matrix32 xform; + Transform2D xform; }; @@ -153,7 +153,7 @@ private: int occluder_light_mask; - void _fix_cell_transform(Matrix32& xform, const Cell& p_cell, const Vector2 &p_offset, const Size2 &p_sc); + void _fix_cell_transform(Transform2D& xform, const Cell& p_cell, const Vector2 &p_offset, const Size2 &p_sc); Map<PosKey,Quadrant>::Element *_create_quadrant(const PosKey& p_qk); void _erase_quadrant(Map<PosKey,Quadrant>::Element *Q); @@ -240,10 +240,10 @@ public: void set_tile_origin(TileOrigin p_tile_origin); TileOrigin get_tile_origin() const; - void set_custom_transform(const Matrix32& p_xform); - Matrix32 get_custom_transform() const; + void set_custom_transform(const Transform2D& p_xform); + Transform2D get_custom_transform() const; - Matrix32 get_cell_transform() const; + Transform2D get_cell_transform() const; Vector2 get_cell_draw_offset() const; Vector2 map_to_world(const Vector2& p_pos, bool p_ignore_ofs=false) const; diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index 19be12ed91..59d8d7ecac 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -308,7 +308,7 @@ static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; } -void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2* p_uv, const MaterialCache& p_material, const AABB &p_aabb) { +void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2* p_uv, const MaterialCache& p_material, const Rect3 &p_aabb) { @@ -477,7 +477,7 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const //go down for(int i=0;i<8;i++) { - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) @@ -488,7 +488,7 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const aabb.pos.z+=aabb.size.z; { - AABB test_aabb=aabb; + Rect3 test_aabb=aabb; //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test @@ -1534,9 +1534,9 @@ int BakedLight::get_cell_subdiv() const { -AABB BakedLight::get_aabb() const { +Rect3 BakedLight::get_aabb() const { - return AABB(Vector3(0,0,0),Vector3(1,1,1)); + return Rect3(Vector3(0,0,0),Vector3(1,1,1)); } PoolVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const { @@ -1549,7 +1549,7 @@ String BakedLight::get_configuration_warning() const { } -void BakedLight::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx) { +void BakedLight::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx) { if (p_level==cell_subdiv-1) { @@ -1585,7 +1585,7 @@ void BakedLight::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMod if (bake_cells_write[p_idx].childs[i]==CHILD_EMPTY) continue; - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h index 461b3adeff..2fda26ecea 100644 --- a/scene/3d/baked_light_instance.h +++ b/scene/3d/baked_light_instance.h @@ -49,7 +49,7 @@ public: private: RID baked_light; int cell_subdiv; - AABB bounds; + Rect3 bounds; int cells_per_axis; enum { @@ -112,12 +112,12 @@ private: - void _plot_face(int p_idx,int p_level,const Vector3 *p_vtx,const Vector2* p_uv, const MaterialCache& p_material,const AABB& p_aabb); + void _plot_face(int p_idx,int p_level,const Vector3 *p_vtx,const Vector2* p_uv, const MaterialCache& p_material,const Rect3& p_aabb); void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z); void _bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh); void _bake_add_to_aabb(const Transform& p_xform,Ref<Mesh>& p_mesh,bool &first); - void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx); + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx); void _debug_mesh_albedo(); void _debug_mesh_light(); @@ -156,7 +156,7 @@ public: void create_debug_mesh(DebugMode p_mode); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; String get_configuration_warning() const; diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 6cc0291707..d0612986df 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -200,7 +200,7 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { Vector3 p1(polygon[i].x,polygon[i].y,depth*0.5); if (i==0) - aabb=AABB(p1,Vector3()); + aabb=Rect3(p1,Vector3()); else aabb.expand_to(p1); @@ -209,9 +209,9 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { } - if (aabb==AABB()) { + if (aabb==Rect3()) { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } else { aabb.pos-=aabb.size*0.3; aabb.size+=aabb.size*0.6; @@ -240,7 +240,7 @@ CollisionPolygon::BuildMode CollisionPolygon::get_build_mode() const{ return build_mode; } -AABB CollisionPolygon::get_item_rect() const { +Rect3 CollisionPolygon::get_item_rect() const { return aabb; } @@ -294,7 +294,7 @@ void CollisionPolygon::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Triangles"),_SCS("set_build_mode"),_SCS("get_build_mode")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"depth"),_SCS("set_depth"),_SCS("get_depth")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); } @@ -304,7 +304,7 @@ CollisionPolygon::CollisionPolygon() { shape_to=-1; can_update_body=false; - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); build_mode=BUILD_SOLIDS; depth=1.0; diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index 8373832699..693cf0640a 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -48,7 +48,7 @@ protected: float depth; - AABB aabb; + Rect3 aabb; BuildMode build_mode; Vector<Point2> polygon; @@ -78,7 +78,7 @@ public: void set_polygon(const Vector<Point2>& p_polygon); Vector<Point2> get_polygon() const; - virtual AABB get_item_rect() const; + virtual Rect3 get_item_rect() const; int get_collision_object_first_shape() const { return shape_from; } int get_collision_object_last_shape() const { return shape_to; } diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 438be13394..13e7c175ed 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -2,12 +2,12 @@ #include "mesh_instance.h" -void GIProbeData::set_bounds(const AABB& p_bounds) { +void GIProbeData::set_bounds(const Rect3& p_bounds) { VS::get_singleton()->gi_probe_set_bounds(probe,p_bounds); } -AABB GIProbeData::get_bounds() const{ +Rect3 GIProbeData::get_bounds() const{ return VS::get_singleton()->gi_probe_get_bounds(probe); } @@ -127,11 +127,11 @@ void GIProbeData::_bind_methods() { ClassDB::bind_method(_MD("set_compress","compress"),&GIProbeData::set_compress); ClassDB::bind_method(_MD("is_compressed"),&GIProbeData::is_compressed); - ADD_PROPERTY(PropertyInfo(Variant::_AABB,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); + ADD_PROPERTY(PropertyInfo(Variant::RECT3,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_cell_size"),_SCS("get_cell_size")); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_to_cell_xform"),_SCS("get_to_cell_xform")); - ADD_PROPERTY(PropertyInfo(Variant::INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); @@ -427,7 +427,7 @@ static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; } -void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const AABB &p_aabb,Baker *p_baker) { +void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker) { @@ -611,7 +611,7 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V int half = (1<<(p_baker->cell_subdiv-1)) >> (p_level+1); for(int i=0;i<8;i++) { - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; int nx=p_x; @@ -635,7 +635,7 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V continue; { - AABB test_aabb=aabb; + Rect3 test_aabb=aabb; //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test @@ -1001,11 +1001,11 @@ void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { - AABB aabb = mesh->get_aabb(); + Rect3 aabb = mesh->get_aabb(); Transform xf = get_global_transform().affine_inverse() * mi->get_global_transform(); - if (AABB(-extents,extents*2).intersects(xf.xform(aabb))) { + if (Rect3(-extents,extents*2).intersects(xf.xform(aabb))) { Baker::PlotMesh pm; pm.local_xform=xf; pm.mesh=mesh; @@ -1039,7 +1039,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ baker.bake_cells.resize(1); //find out the actual real bounds, power of 2, which gets the highest subdivision - baker.po2_bounds=AABB(-extents,extents*2.0); + baker.po2_bounds=Rect3(-extents,extents*2.0); int longest_axis = baker.po2_bounds.get_longest_axis_index(); baker.axis_cell_size[longest_axis]=(1<<(baker.cell_subdiv-1)); baker.leaf_voxel_count=0; @@ -1169,7 +1169,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ Ref<GIProbeData> probe_data; probe_data.instance(); - probe_data->set_bounds(AABB(-extents,extents*2.0)); + probe_data->set_bounds(Rect3(-extents,extents*2.0)); probe_data->set_cell_size(baker.po2_bounds.size[longest_axis]/baker.axis_cell_size[longest_axis]); probe_data->set_dynamic_data(data); probe_data->set_dynamic_range(dynamic_range); @@ -1190,7 +1190,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ } -void GIProbe::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker) { +void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker) { if (p_level==p_baker->cell_subdiv-1) { @@ -1212,7 +1212,7 @@ void GIProbe::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMe if (p_baker->bake_cells[p_idx].childs[i]==Baker::CHILD_EMPTY) continue; - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) @@ -1332,9 +1332,9 @@ void GIProbe::_debug_bake() { bake(NULL,true); } -AABB GIProbe::get_aabb() const { +Rect3 GIProbe::get_aabb() const { - return AABB(-extents,extents*2); + return Rect3(-extents,extents*2); } PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 55cde2960a..e416b28791 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -17,8 +17,8 @@ public: - void set_bounds(const AABB& p_bounds); - AABB get_bounds() const; + void set_bounds(const Rect3& p_bounds); + Rect3 get_bounds() const; void set_cell_size(float p_size); float get_cell_size() const; @@ -110,7 +110,7 @@ private: int leaf_voxel_count; - AABB po2_bounds; + Rect3 po2_bounds; int axis_cell_size[3]; struct PlotMesh { @@ -140,12 +140,12 @@ private: Vector<Color> _get_bake_texture(Image &p_image,const Color& p_color); Baker::MaterialCache _get_material_cache(Ref<Material> p_material,Baker *p_baker); - void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const AABB &p_aabb,Baker *p_baker); + void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker); void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker); void _find_meshes(Node *p_at_node,Baker *p_baker); void _fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker); - void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker); + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker); void _create_debug_mesh(Baker *p_baker); void _debug_bake(); @@ -178,7 +178,7 @@ public: void bake(Node *p_from_node=NULL,bool p_create_visual_debug=false); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; GIProbe(); diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index ee200cb3ea..08fc1f59e8 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -92,7 +92,7 @@ void ImmediateGeometry::clear(){ } -AABB ImmediateGeometry::get_aabb() const { +Rect3 ImmediateGeometry::get_aabb() const { return aabb; } diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index bf624e67fd..e385a34da1 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -42,7 +42,7 @@ class ImmediateGeometry : public GeometryInstance { // in VisualServer from becoming invalid if the texture is no longer used List<Ref<Texture> > cached_textures; bool empty; - AABB aabb; + Rect3 aabb; protected: static void _bind_methods(); @@ -66,7 +66,7 @@ public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; ImmediateGeometry(); diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 2322df6a9e..50ee3482c3 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -114,25 +114,25 @@ Color Light::get_shadow_color() const{ } -AABB Light::get_aabb() const { +Rect3 Light::get_aabb() const { if (type==VisualServer::LIGHT_DIRECTIONAL) { - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } else if (type==VisualServer::LIGHT_OMNI) { - return AABB( Vector3(-1,-1,-1) * param[PARAM_RANGE], Vector3(2, 2, 2 ) * param[PARAM_RANGE]); + return Rect3( Vector3(-1,-1,-1) * param[PARAM_RANGE], Vector3(2, 2, 2 ) * param[PARAM_RANGE]); } else if (type==VisualServer::LIGHT_SPOT) { float len=param[PARAM_RANGE]; float size=Math::tan(Math::deg2rad(param[PARAM_SPOT_ANGLE]))*len; - return AABB( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); + return Rect3( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); } - return AABB(); + return Rect3(); } PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/light.h b/scene/3d/light.h index 3481d0229c..d27b9fed12 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -117,7 +117,7 @@ public: Color get_shadow_color() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; Light(); diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 5b12f80d5c..c4712ecc7a 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -169,12 +169,12 @@ NodePath MeshInstance::get_skeleton_path() { return skeleton_path; } -AABB MeshInstance::get_aabb() const { +Rect3 MeshInstance::get_aabb() const { if (!mesh.is_null()) return mesh->get_aabb(); - return AABB(); + return Rect3(); } PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 1291d6b12f..4d28cc2942 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -80,7 +80,7 @@ public: Node* create_convex_collision_node(); void create_convex_collision(); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; MeshInstance(); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index a9d1de1cfa..31843fadaa 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -63,10 +63,10 @@ PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { return PoolVector<Face3>(); } -AABB MultiMeshInstance::get_aabb() const { +Rect3 MultiMeshInstance::get_aabb() const { if (multimesh.is_null()) - return AABB(); + return Rect3(); else return multimesh->get_aabb(); } diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index ef2403a44a..535e4275a3 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -54,7 +54,7 @@ public: void set_multimesh(const Ref<MultiMesh>& p_multimesh); Ref<MultiMesh> get_multimesh() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; MultiMeshInstance(); ~MultiMeshInstance(); diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 7ec9085e30..434b400e01 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -219,7 +219,7 @@ void NavigationMesh::_bind_methods() { ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); ClassDB::bind_method(_MD("_get_polygons"),&NavigationMesh::_get_polygons); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); } diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 98a81fc150..5e8ded3867 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -137,7 +137,7 @@ void PathFollow::_update_transform() { float tilt = c->interpolate_baked_tilt(o); if (tilt!=0) { - Matrix3 rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. + Basis rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. up=rot.xform(up); } } diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index e4c03a78ee..054b61a4ed 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -88,7 +88,7 @@ bool Portal::_get(const StringName& p_name,Variant &r_ret) const { void Portal::_get_property_list( List<PropertyInfo> *p_list) const { - p_list->push_back( PropertyInfo( Variant::REAL_ARRAY, "shape" ) ); + p_list->push_back( PropertyInfo( Variant::POOL_REAL_ARRAY, "shape" ) ); p_list->push_back( PropertyInfo( Variant::BOOL, "enabled" ) ); p_list->push_back( PropertyInfo( Variant::REAL, "disable_distance",PROPERTY_HINT_RANGE,"0,4096,0.01" ) ); p_list->push_back( PropertyInfo( Variant::COLOR, "disabled_color") ); @@ -98,7 +98,7 @@ void Portal::_get_property_list( List<PropertyInfo> *p_list) const { -AABB Portal::get_aabb() const { +Rect3 Portal::get_aabb() const { return aabb; } diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 8464a628f9..077924c7e8 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -54,7 +54,7 @@ class Portal : public VisualInstance { Color disabled_color; float connect_range; - AABB aabb; + Rect3 aabb; protected: @@ -67,7 +67,7 @@ protected: public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_enabled(bool p_enabled); diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index f1c59860af..d1cef0e851 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -66,7 +66,7 @@ void Quad::_update() { pointsw[3][a2]=-s2.y+offset.y; - aabb=AABB(pointsw[0],Vector3()); + aabb=Rect3(pointsw[0],Vector3()); for(int i=1;i<4;i++) aabb.expand_to(pointsw[i]); @@ -192,7 +192,7 @@ PoolVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { return PoolVector<Face3>(); } -AABB Quad::get_aabb() const { +Rect3 Quad::get_aabb() const { return aabb; } diff --git a/scene/3d/quad.h b/scene/3d/quad.h index 94b438c548..af91d7a1f5 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -42,7 +42,7 @@ class Quad : public GeometryInstance { Vector2 offset; Vector2 size; - AABB aabb; + Rect3 aabb; bool configured; bool pending_update; RID mesh; @@ -68,7 +68,7 @@ public: bool is_centered() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; Quad(); ~Quad(); diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index fe56560483..d9592d9484 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -162,9 +162,9 @@ ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const { } -AABB ReflectionProbe::get_aabb() const { +Rect3 ReflectionProbe::get_aabb() const { - AABB aabb; + Rect3 aabb; aabb.pos=-origin_offset; aabb.size=origin_offset+extents; return aabb; diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index 789e5837b0..410f590431 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.h @@ -77,7 +77,7 @@ public: void set_update_mode(UpdateMode p_mode); UpdateMode get_update_mode() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 137a16490d..0b19aaf151 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -78,12 +78,12 @@ void Room::_notification(int p_what) { -AABB Room::get_aabb() const { +Rect3 Room::get_aabb() const { if (room.is_null()) - return AABB(); + return Rect3(); - return AABB(); + return Rect3(); } PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 8cdc908ceb..145589a780 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -82,7 +82,7 @@ public: NOTIFICATION_AREA_CHANGED=60 }; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_room( const Ref<RoomBounds>& p_room ); diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 50f9e45019..60580911da 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -83,7 +83,7 @@ void Spatial::_notify_dirty() { void Spatial::_update_local_transform() const { - data.local_transform.basis = Matrix3(); + data.local_transform.basis = Basis(); data.local_transform.basis.scale(data.scale); data.local_transform.basis.rotate(data.rotation); @@ -682,7 +682,7 @@ void Spatial::scale(const Vector3& p_ratio){ } void Spatial::global_rotate(const Vector3& p_normal,float p_radians){ - Matrix3 rotation(p_normal,p_radians); + Basis rotation(p_normal,p_radians); Transform t = get_global_transform(); t.basis= rotation * t.basis; set_global_transform(t); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 52ae8fc5ab..a2a96d7d0e 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -207,7 +207,7 @@ void SpriteBase3D::_queue_update(){ } -AABB SpriteBase3D::get_aabb() const { +Rect3 SpriteBase3D::get_aabb() const { return aabb; } @@ -445,7 +445,7 @@ void Sprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); @@ -961,7 +961,7 @@ void AnimatedSprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index f82a391038..f5d3957370 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -73,7 +73,7 @@ private: Vector3::Axis axis; float pixel_size; - AABB aabb; + Rect3 aabb; RID immediate; @@ -91,7 +91,7 @@ protected: void _notification(int p_what); static void _bind_methods(); virtual void _draw()=0; - _FORCE_INLINE_ void set_aabb(const AABB& p_aabb) { aabb=p_aabb; } + _FORCE_INLINE_ void set_aabb(const Rect3& p_aabb) { aabb=p_aabb; } _FORCE_INLINE_ RID& get_immediate() { return immediate; } void _queue_update(); public: @@ -134,7 +134,7 @@ public: virtual Rect2 get_item_rect() const=0; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; SpriteBase3D(); diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index c2ebe63e21..c52e596032 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -31,9 +31,9 @@ -AABB TestCube::get_aabb() const { +Rect3 TestCube::get_aabb() const { - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } PoolVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index c62999c34b..4860bacd8d 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -46,7 +46,7 @@ class TestCube : public GeometryInstance { public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; TestCube(); diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 0d603902e1..1cb443225c 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -47,8 +47,8 @@ public: btVehicleJacobianEntry() {}; //constraint between two different rigidbodies btVehicleJacobianEntry( - const Matrix3& world2A, - const Matrix3& world2B, + const Basis& world2A, + const Basis& world2B, const Vector3& rel_pos1, const Vector3& rel_pos2, const Vector3& jointAxis, @@ -367,14 +367,14 @@ void VehicleBody::_update_wheel(int p_idx,PhysicsDirectBodyState *s) { real_t steering = wheel.steers?m_steeringValue:0.0; //print_line(itos(p_idx)+": "+rtos(steering)); - Matrix3 steeringMat(up,steering); + Basis steeringMat(up,steering); - Matrix3 rotatingMat(right,-wheel.m_rotation); + Basis rotatingMat(right,-wheel.m_rotation); // if (p_idx==1) // print_line("steeringMat " +steeringMat); - Matrix3 basis2( + Basis basis2( right[0],up[0],fwd[0], right[1],up[1],fwd[1], right[2],up[2],fwd[2] @@ -574,7 +574,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec Vector3 vel = vel1 - vel2; - Matrix3 b2trans; + Basis b2trans; float b2invmass=0; Vector3 b2lv; Vector3 b2av; @@ -728,7 +728,7 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) { //const btTransform& wheelTrans = getWheelTransformWS( i ); - Matrix3 wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; + Basis wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; m_axle[i] = wheelBasis0.get_axis(Vector3::AXIS_X); //m_axle[i] = wheelInfo.m_raycastInfo.m_wheelAxleWS; diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 508e24497f..0d9d2ad725 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -60,7 +60,7 @@ void VisibilityNotifier::_exit_camera(Camera* p_camera){ } -void VisibilityNotifier::set_aabb(const AABB& p_aabb){ +void VisibilityNotifier::set_aabb(const Rect3& p_aabb){ if (aabb==p_aabb) return; @@ -74,7 +74,7 @@ void VisibilityNotifier::set_aabb(const AABB& p_aabb){ update_gizmo(); } -AABB VisibilityNotifier::get_aabb() const{ +Rect3 VisibilityNotifier::get_aabb() const{ return aabb; } @@ -113,7 +113,7 @@ void VisibilityNotifier::_bind_methods(){ ClassDB::bind_method(_MD("get_aabb"),&VisibilityNotifier::get_aabb); ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier::is_on_screen); - ADD_PROPERTY( PropertyInfo(Variant::_AABB,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); + ADD_PROPERTY( PropertyInfo(Variant::RECT3,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); ADD_SIGNAL( MethodInfo("enter_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); ADD_SIGNAL( MethodInfo("exit_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); @@ -124,7 +124,7 @@ void VisibilityNotifier::_bind_methods(){ VisibilityNotifier::VisibilityNotifier() { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index ca01a9ec18..aa53e1bcd1 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -38,7 +38,7 @@ class VisibilityNotifier : public Spatial { Set<Camera*> cameras; - AABB aabb; + Rect3 aabb; protected: @@ -54,8 +54,8 @@ friend class SpatialIndexer; public: - void set_aabb(const AABB& p_aabb); - AABB get_aabb() const; + void set_aabb(const Rect3& p_aabb); + Rect3 get_aabb() const; bool is_on_screen() const; VisibilityNotifier(); diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 812fb93dd1..466c273154 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -33,7 +33,7 @@ #include "scene/scene_string_names.h" #include "skeleton.h" -AABB VisualInstance::get_transformed_aabb() const { +Rect3 VisualInstance::get_transformed_aabb() const { return get_global_transform().xform( get_aabb() ); } diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index f59ec3a7e6..5955dae236 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -65,10 +65,10 @@ public: }; RID get_instance() const; - virtual AABB get_aabb() const=0; + virtual Rect3 get_aabb() const=0; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const=0; - virtual AABB get_transformed_aabb() const; // helper + virtual Rect3 get_transformed_aabb() const; // helper void set_base(const RID& p_base); diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index b9ed08326d..4ab6e2e575 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -292,7 +292,7 @@ void AnimationCache::set_all(float p_time, float p_delta) { Vector3 loc,scale; Quat rot; animation->transform_track_interpolate(i,p_time,&loc,&rot,&scale); - Transform tr( Matrix3(rot), loc ); + Transform tr( Basis(rot), loc ); tr.basis.scale(scale); set_track_transform(i,tr); diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 5bc9a81c85..d2b95c78e6 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -383,11 +383,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { } break; - case Variant::MATRIX3: + case Variant::BASIS: { - Matrix3 i = initial_val; - Matrix3 d = delta_val; - Matrix3 r; + Basis i = initial_val; + Basis d = delta_val; + Basis r; APPLY_EQUATION(elements[0][0]); APPLY_EQUATION(elements[0][1]); @@ -403,11 +403,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { } break; - case Variant::MATRIX32: + case Variant::TRANSFORM2D: { - Matrix3 i = initial_val; - Matrix3 d = delta_val; - Matrix3 r; + Basis i = initial_val; + Basis d = delta_val; + Basis r; APPLY_EQUATION(elements[0][0]); APPLY_EQUATION(elements[0][1]); @@ -433,11 +433,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { result = r; } break; - case Variant::_AABB: + case Variant::RECT3: { - AABB i = initial_val; - AABB d = delta_val; - AABB r; + Rect3 i = initial_val; + Rect3 d = delta_val; + Rect3 r; APPLY_EQUATION(pos.x); APPLY_EQUATION(pos.y); @@ -953,11 +953,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final delta_val = final_val.operator Vector3() - initial_val.operator Vector3(); break; - case Variant::MATRIX3: + case Variant::BASIS: { - Matrix3 i = initial_val; - Matrix3 f = final_val; - delta_val = Matrix3(f.elements[0][0] - i.elements[0][0], + Basis i = initial_val; + Basis f = final_val; + delta_val = Basis(f.elements[0][0] - i.elements[0][0], f.elements[0][1] - i.elements[0][1], f.elements[0][2] - i.elements[0][2], f.elements[1][0] - i.elements[1][0], @@ -970,11 +970,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final } break; - case Variant::MATRIX32: + case Variant::TRANSFORM2D: { - Matrix32 i = initial_val; - Matrix32 f = final_val; - Matrix32 d = Matrix32(); + Transform2D i = initial_val; + Transform2D f = final_val; + Transform2D d = Transform2D(); d[0][0] = f.elements[0][0] - i.elements[0][0]; d[0][1] = f.elements[0][1] - i.elements[0][1]; d[1][0] = f.elements[1][0] - i.elements[1][0]; @@ -987,11 +987,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final case Variant::QUAT: delta_val = final_val.operator Quat() - initial_val.operator Quat(); break; - case Variant::_AABB: + case Variant::RECT3: { - AABB i = initial_val; - AABB f = final_val; - delta_val = AABB(f.pos - i.pos, f.size - i.size); + Rect3 i = initial_val; + Rect3 f = final_val; + delta_val = Rect3(f.pos - i.pos, f.size - i.size); } break; case Variant::TRANSFORM: diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index a4b07d9a13..b3d86f85ea 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -96,7 +96,7 @@ Size2 Control::edit_get_minimum_size() const { void Control::edit_set_rect(const Rect2& p_edit_rect) { - Matrix32 postxf; + Transform2D postxf; postxf.set_rotation_and_scale(data.rotation,data.scale); Vector2 new_pos = postxf.xform(p_edit_rect.pos); @@ -374,7 +374,7 @@ void Control::remove_child_notify(Node *p_child) { void Control::_update_canvas_item_transform() { - Matrix32 xform=Matrix32(data.rotation,get_pos()); + Transform2D xform=Transform2D(data.rotation,get_pos()); xform.scale_basis(data.scale); VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),xform); @@ -1382,7 +1382,7 @@ Point2 Control::get_global_pos() const { void Control::set_global_pos(const Point2& p_point) { - Matrix32 inv; + Transform2D inv; if (data.parent_canvas_item) { @@ -1918,9 +1918,9 @@ Control::CursorShape Control::get_cursor_shape(const Point2& p_pos) const { return data.default_cursor; } -Matrix32 Control::get_transform() const { +Transform2D Control::get_transform() const { - Matrix32 xform=Matrix32(data.rotation,get_pos()); + Transform2D xform=Transform2D(data.rotation,get_pos()); xform.scale_basis(data.scale); return xform; } @@ -1981,7 +1981,7 @@ Control *Control::_get_focus_neighbour(Margin p_margin,int p_count) { Point2 points[4]; - Matrix32 xform = get_global_transform(); + Transform2D xform = get_global_transform(); Rect2 rect = get_item_rect(); points[0]=xform.xform(rect.pos); @@ -2041,7 +2041,7 @@ void Control::_window_find_focus_neighbour(const Vector2& p_dir, Node *p_at,cons Point2 points[4]; - Matrix32 xform = c->get_global_transform(); + Transform2D xform = c->get_global_transform(); Rect2 rect = c->get_item_rect(); points[0]=xform.xform(rect.pos); diff --git a/scene/gui/control.h b/scene/gui/control.h index 709f19f3f2..68795b054c 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -168,7 +168,7 @@ private: } data; // used internally - Control* _find_control_at_pos(CanvasItem* p_node,const Point2& p_pos,const Matrix32& p_xform,Matrix32& r_inv_xform); + Control* _find_control_at_pos(CanvasItem* p_node,const Point2& p_pos,const Transform2D& p_xform,Transform2D& r_inv_xform); void _window_find_focus_neighbour(const Vector2& p_dir, Node *p_at, const Point2* p_points ,float p_min,float &r_closest_dist,Control **r_closest); @@ -389,7 +389,7 @@ public: virtual CursorShape get_cursor_shape(const Point2& p_pos=Point2i()) const; virtual Rect2 get_item_rect() const; - virtual Matrix32 get_transform() const; + virtual Transform2D get_transform() const; bool is_toplevel_control() const; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index df08c7ea56..1cd04551c5 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -723,7 +723,7 @@ void FileDialog::_bind_methods() { ClassDB::bind_method(_MD("invalidate"),&FileDialog::invalidate); ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path"))); - ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::STRING_ARRAY,"paths"))); + ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths"))); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo( Variant::STRING,"dir"))); BIND_CONSTANT( MODE_OPEN_FILE ); @@ -739,7 +739,7 @@ void FileDialog::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"),_SCS("set_mode"),_SCS("get_mode") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"),_SCS("set_access"),_SCS("get_access") ); - ADD_PROPERTY( PropertyInfo(Variant::STRING_ARRAY, "filters"),_SCS("set_filters"),_SCS("get_filters") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY, "filters"),_SCS("set_filters"),_SCS("get_filters") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "show_hidden_files"),_SCS("set_show_hidden_files"),_SCS("is_showing_hidden_files") ); } diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index c5fdcddf15..2e2e1d6c80 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -43,7 +43,7 @@ int CanvasLayer::get_layer() const{ return layer; } -void CanvasLayer::set_transform(const Matrix32& p_xform) { +void CanvasLayer::set_transform(const Transform2D& p_xform) { transform=p_xform; locrotscale_dirty=true; @@ -52,7 +52,7 @@ void CanvasLayer::set_transform(const Matrix32& p_xform) { } -Matrix32 CanvasLayer::get_transform() const { +Transform2D CanvasLayer::get_transform() const { return transform; } diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index ea05fd7e1f..8efbbd5a05 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -43,7 +43,7 @@ class CanvasLayer : public Node { Size2 scale; real_t rot; int layer; - Matrix32 transform; + Transform2D transform; Ref<World2D> canvas; ObjectID custom_viewport_id; // to check validity @@ -71,8 +71,8 @@ public: void set_layer(int p_xform); int get_layer() const; - void set_transform(const Matrix32& p_xform); - Matrix32 get_transform() const; + void set_transform(const Transform2D& p_xform); + Transform2D get_transform() const; void set_offset(const Vector2& p_offset); Vector2 get_offset() const; diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 848be375ca..25180b568f 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -150,7 +150,7 @@ Error HTTPRequest::request(const String& p_url, const Vector<String>& p_custom_h client->set_blocking_mode(false); err = _request(); if (err!=OK) { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return ERR_CANT_CONNECT; } @@ -170,7 +170,7 @@ void HTTPRequest::_thread_func(void *p_userdata) { Error err = hr->_request(); if (err!=OK) { - hr->call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + hr->call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); } else { while(!hr->thread_request_quit) { @@ -216,7 +216,7 @@ void HTTPRequest::cancel_request() { bool HTTPRequest::_handle_response(bool *ret_value) { if (!client->has_response()) { - call_deferred("_request_done",RESULT_NO_RESPONSE,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_NO_RESPONSE,0,PoolStringArray(),PoolByteArray()); *ret_value=true; return true; } @@ -236,7 +236,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { //redirect if (max_redirects>=0 && redirections>=max_redirects) { - call_deferred("_request_done",RESULT_REDIRECT_LIMIT_REACHED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_REDIRECT_LIMIT_REACHED,response_code,response_headers,PoolByteArray()); *ret_value=true; return true; } @@ -288,7 +288,7 @@ bool HTTPRequest::_update_connection() { switch( client->get_status() ) { case HTTPClient::STATUS_DISCONNECTED: { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return true; //end it, since it's doing something } break; case HTTPClient::STATUS_RESOLVING: { @@ -297,7 +297,7 @@ bool HTTPRequest::_update_connection() { return false; } break; case HTTPClient::STATUS_CANT_RESOLVE: { - call_deferred("_request_done",RESULT_CANT_RESOLVE,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_RESOLVE,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -308,7 +308,7 @@ bool HTTPRequest::_update_connection() { } break; //connecting to ip case HTTPClient::STATUS_CANT_CONNECT: { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -326,7 +326,7 @@ bool HTTPRequest::_update_connection() { return ret_value; - call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,PoolByteArray()); return true; } if (got_response && body_len<0) { @@ -336,7 +336,7 @@ bool HTTPRequest::_update_connection() { } - call_deferred("_request_done",RESULT_CHUNKED_BODY_SIZE_MISMATCH,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_CHUNKED_BODY_SIZE_MISMATCH,response_code,response_headers,PoolByteArray()); return true; //request migh have been done } else { @@ -344,7 +344,7 @@ bool HTTPRequest::_update_connection() { Error err = client->request(method,request_string,headers,request_data); if (err!=OK) { - call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } @@ -370,7 +370,7 @@ bool HTTPRequest::_update_connection() { if (!client->is_response_chunked() && client->get_response_body_length()==0) { - call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,PoolByteArray()); return true; } @@ -381,7 +381,7 @@ bool HTTPRequest::_update_connection() { body_len=client->get_response_body_length(); if (body_size_limit>=0 && body_len>body_size_limit) { - call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,PoolByteArray()); return true; } } @@ -390,7 +390,7 @@ bool HTTPRequest::_update_connection() { file=FileAccess::open(download_to_file,FileAccess::WRITE); if (!file) { - call_deferred("_request_done",RESULT_DOWNLOAD_FILE_CANT_OPEN,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_DOWNLOAD_FILE_CANT_OPEN,response_code,response_headers,PoolByteArray()); return true; } } @@ -400,14 +400,14 @@ bool HTTPRequest::_update_connection() { //print_line("BODY: "+itos(body.size())); client->poll(); - ByteArray chunk = client->read_response_body_chunk(); + PoolByteArray chunk = client->read_response_body_chunk(); downloaded+=chunk.size(); if (file) { - ByteArray::Read r=chunk.read(); + PoolByteArray::Read r=chunk.read(); file->store_buffer(r.ptr(),chunk.size()); if (file->get_error()!=OK) { - call_deferred("_request_done",RESULT_DOWNLOAD_FILE_WRITE_ERROR,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_DOWNLOAD_FILE_WRITE_ERROR,response_code,response_headers,PoolByteArray()); return true; } } else { @@ -415,7 +415,7 @@ bool HTTPRequest::_update_connection() { } if (body_size_limit>=0 && downloaded>body_size_limit) { - call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,PoolByteArray()); return true; } @@ -435,11 +435,11 @@ bool HTTPRequest::_update_connection() { } break; // request resulted in body: { } break which must be read case HTTPClient::STATUS_CONNECTION_ERROR: { - call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } break; case HTTPClient::STATUS_SSL_HANDSHAKE_ERROR: { - call_deferred("_request_done",RESULT_SSL_HANDSHAKE_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_SSL_HANDSHAKE_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -449,7 +449,7 @@ bool HTTPRequest::_update_connection() { } -void HTTPRequest::_request_done(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) { +void HTTPRequest::_request_done(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) { cancel_request(); @@ -540,7 +540,7 @@ int HTTPRequest::get_body_size() const{ void HTTPRequest::_bind_methods() { ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPRequest::set_ip_type); - ClassDB::bind_method(_MD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(StringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); + ClassDB::bind_method(_MD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(PoolStringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); ClassDB::bind_method(_MD("cancel_request"),&HTTPRequest::cancel_request); ClassDB::bind_method(_MD("get_http_client_status"),&HTTPRequest::get_http_client_status); @@ -567,7 +567,7 @@ void HTTPRequest::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT,"body_size_limit",PROPERTY_HINT_RANGE,"-1,2000000000"),_SCS("set_body_size_limit"),_SCS("get_body_size_limit")); ADD_PROPERTY(PropertyInfo(Variant::INT,"max_redirects",PROPERTY_HINT_RANGE,"-1,1024"),_SCS("set_max_redirects"),_SCS("get_max_redirects")); - ADD_SIGNAL(MethodInfo("request_completed",PropertyInfo(Variant::INT,"result"),PropertyInfo(Variant::INT,"response_code"),PropertyInfo(Variant::STRING_ARRAY,"headers"),PropertyInfo(Variant::RAW_ARRAY,"body"))); + ADD_SIGNAL(MethodInfo("request_completed",PropertyInfo(Variant::INT,"result"),PropertyInfo(Variant::INT,"response_code"),PropertyInfo(Variant::POOL_STRING_ARRAY,"headers"),PropertyInfo(Variant::POOL_BYTE_ARRAY,"body"))); BIND_CONSTANT( RESULT_SUCCESS ); //BIND_CONSTANT( RESULT_NO_BODY ); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 59be980077..51c5ddeb69 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -71,7 +71,7 @@ private: bool request_sent; Ref<HTTPClient> client; - ByteArray body; + PoolByteArray body; volatile bool use_threads; bool got_response; @@ -107,7 +107,7 @@ private: Thread *thread; - void _request_done(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data); + void _request_done(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data); static void _thread_func(void *p_userdata); protected: diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 289adc3c53..5d1b0495c0 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -106,7 +106,7 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { Dictionary ret; - StringArray order; + PoolStringArray order; for(List<PropSet>::Element *E=stored_values.front();E;E=E->next()) { ret[E->get().name] = E->get().value; diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index 5cb60d25d9..487b740c34 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -2245,7 +2245,7 @@ void SceneTree::_bind_methods() { ADD_SIGNAL( MethodInfo("idle_frame")); ADD_SIGNAL( MethodInfo("fixed_frame")); - ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); + ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); ADD_SIGNAL( MethodInfo("network_peer_connected",PropertyInfo(Variant::INT,"id"))); ADD_SIGNAL( MethodInfo("network_peer_disconnected",PropertyInfo(Variant::INT,"id"))); ADD_SIGNAL( MethodInfo("connected_to_server")); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index bd80f97c22..fe363d97f7 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -203,7 +203,7 @@ void Viewport::_update_stretch_transform() { //print_line("sive override size "+size_override_size); //print_line("rect size "+size); - stretch_transform=Matrix32(); + stretch_transform=Transform2D(); Size2 scale = size/(size_override_size+size_override_margin*2); stretch_transform.scale(scale); stretch_transform.elements[2]=size_override_margin*scale; @@ -212,7 +212,7 @@ void Viewport::_update_stretch_transform() { } else { - stretch_transform=Matrix32(); + stretch_transform=Transform2D(); } _update_global_transform(); @@ -833,14 +833,14 @@ bool Viewport::is_audio_listener_2d() const { return audio_listener_2d; } -void Viewport::set_canvas_transform(const Matrix32& p_transform) { +void Viewport::set_canvas_transform(const Transform2D& p_transform) { canvas_transform=p_transform; VisualServer::get_singleton()->viewport_set_canvas_transform(viewport,find_world_2d()->get_canvas(),canvas_transform); - Matrix32 xform = (global_canvas_transform * canvas_transform).affine_inverse(); + Transform2D xform = (global_canvas_transform * canvas_transform).affine_inverse(); Size2 ss = get_visible_rect().size; - SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Matrix32(0, xform.xform(ss*0.5))); + SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5))); Vector2 ss2 = ss*xform.get_scale(); float panrange = MAX(ss2.x,ss2.y); @@ -849,7 +849,7 @@ void Viewport::set_canvas_transform(const Matrix32& p_transform) { } -Matrix32 Viewport::get_canvas_transform() const{ +Transform2D Viewport::get_canvas_transform() const{ return canvas_transform; } @@ -859,13 +859,13 @@ Matrix32 Viewport::get_canvas_transform() const{ void Viewport::_update_global_transform() { - Matrix32 sxform = stretch_transform * global_canvas_transform; + Transform2D sxform = stretch_transform * global_canvas_transform; VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport,sxform); - Matrix32 xform = (sxform * canvas_transform).affine_inverse(); + Transform2D xform = (sxform * canvas_transform).affine_inverse(); Size2 ss = get_visible_rect().size; - SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Matrix32(0, xform.xform(ss*0.5))); + SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5))); Vector2 ss2 = ss*xform.get_scale(); float panrange = MAX(ss2.x,ss2.y); @@ -874,7 +874,7 @@ void Viewport::_update_global_transform() { } -void Viewport::set_global_canvas_transform(const Matrix32& p_transform) { +void Viewport::set_global_canvas_transform(const Transform2D& p_transform) { global_canvas_transform=p_transform; @@ -883,7 +883,7 @@ void Viewport::set_global_canvas_transform(const Matrix32& p_transform) { } -Matrix32 Viewport::get_global_canvas_transform() const{ +Transform2D Viewport::get_global_canvas_transform() const{ return global_canvas_transform; } @@ -1205,7 +1205,7 @@ Camera* Viewport::get_camera() const { } -Matrix32 Viewport::get_final_transform() const { +Transform2D Viewport::get_final_transform() const { return stretch_transform * global_canvas_transform; } @@ -1383,9 +1383,9 @@ void Viewport::clear() { } -Matrix32 Viewport::_get_input_pre_xform() const { +Transform2D Viewport::_get_input_pre_xform() const { - Matrix32 pre_xf; + Transform2D pre_xf; if (to_screen_rect!=Rect2()) { @@ -1415,7 +1415,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y)); Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y)-vp_ofs); @@ -1430,7 +1430,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y)); Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y)-vp_ofs); Vector2 r = ai.basis_xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y)); @@ -1451,7 +1451,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y)-vp_ofs); @@ -1463,7 +1463,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y)-vp_ofs); Vector2 r = ai.basis_xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y)); Vector2 s = ai.basis_xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y)); @@ -1699,7 +1699,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { if (!sw->is_visible()) continue; - Matrix32 xform; + Transform2D xform; CanvasItem *pci = sw->get_parent_item(); if (pci) xform=pci->get_global_transform_with_canvas(); @@ -1719,7 +1719,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { if (!sw->is_visible()) continue; - Matrix32 xform; + Transform2D xform; CanvasItem *pci = sw->get_parent_item(); if (pci) xform=pci->get_global_transform_with_canvas(); @@ -1737,7 +1737,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { } -Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Matrix32& p_xform,Matrix32& r_inv_xform) { +Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Transform2D& p_xform,Transform2D& r_inv_xform) { if (p_node->cast_to<Viewport>()) return NULL; @@ -1755,7 +1755,7 @@ Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_g return NULL; //canvas item hidden, discard } - Matrix32 matrix = p_xform * p_node->get_transform(); + Transform2D matrix = p_xform * p_node->get_transform(); // matrix.basis_determinant() == 0.0f implies that node does not exist on scene if(matrix.basis_determinant() == 0.0f) return NULL; @@ -2060,7 +2060,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { } - Matrix32 localizer = over->get_global_transform_with_canvas().affine_inverse(); + Transform2D localizer = over->get_global_transform_with_canvas().affine_inverse(); Size2 pos = localizer.xform(mpos); Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x,p_event.mouse_motion.speed_y)); Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x,p_event.mouse_motion.relative_y)); @@ -2587,7 +2587,7 @@ void Viewport::set_physics_object_picking(bool p_enable) { Vector2 Viewport::get_camera_coords(const Vector2 &p_viewport_coords) const { - Matrix32 xf = get_final_transform(); + Transform2D xf = get_final_transform(); return xf.xform(p_viewport_coords); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 6666565069..1f30044cef 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -137,9 +137,9 @@ friend class ViewportTexture; bool audio_listener_2d; RID internal_listener_2d; - Matrix32 canvas_transform; - Matrix32 global_canvas_transform; - Matrix32 stretch_transform; + Transform2D canvas_transform; + Transform2D global_canvas_transform; + Transform2D stretch_transform; Size2 size; Rect2 to_screen_rect; @@ -232,7 +232,7 @@ friend class ViewportTexture; float tooltip_delay; List<Control*> modal_stack; unsigned int cancelled_input_ID; - Matrix32 focus_inv_xform; + Transform2D focus_inv_xform; bool subwindow_order_dirty; List<Control*> subwindows; bool roots_order_dirty; @@ -250,14 +250,14 @@ friend class ViewportTexture; void _gui_sort_roots(); void _gui_sort_modal_stack(); Control* _gui_find_control(const Point2& p_global); - Control* _gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Matrix32& p_xform,Matrix32& r_inv_xform); + Control* _gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Transform2D& p_xform,Transform2D& r_inv_xform); void _gui_input_event(InputEvent p_event); void update_worlds(); - _FORCE_INLINE_ Matrix32 _get_input_pre_xform() const; + _FORCE_INLINE_ Transform2D _get_input_pre_xform() const; void _vp_enter_tree(); void _vp_exit_tree(); @@ -351,13 +351,13 @@ public: Ref<World2D> find_world_2d() const; - void set_canvas_transform(const Matrix32& p_transform); - Matrix32 get_canvas_transform() const; + void set_canvas_transform(const Transform2D& p_transform); + Transform2D get_canvas_transform() const; - void set_global_canvas_transform(const Matrix32& p_transform); - Matrix32 get_global_canvas_transform() const; + void set_global_canvas_transform(const Transform2D& p_transform); + Transform2D get_global_canvas_transform() const; - Matrix32 get_final_transform() const; + Transform2D get_final_transform() const; void set_transparent_background(bool p_enable); bool has_transparent_background() const; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index c962e1a671..1fbb149bf3 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1203,14 +1203,14 @@ Variant Animation::_cubic_interpolate( const Variant& p_pre_a,const Variant& p_a return a.cubic_slerp(b,pa,pb,p_c); } break; - case Variant::_AABB: { + case Variant::RECT3: { - AABB a=p_a; - AABB b=p_b; - AABB pa=p_pre_a; - AABB pb=p_post_b; + Rect3 a=p_a; + Rect3 b=p_b; + Rect3 pa=p_pre_a; + Rect3 pb=p_post_b; - return AABB( + return Rect3( a.pos.cubic_interpolate(b.pos,pa.pos,pb.pos,p_c), a.size.cubic_interpolate(b.size,pa.size,pb.size,p_c) ); diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index fa5b35ca41..87585af862 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -34,7 +34,7 @@ Vector<Vector3> BoxShape::_gen_debug_mesh_lines() { Vector<Vector3> lines; - AABB aabb; + Rect3 aabb; aabb.pos=-get_extents(); aabb.size=aabb.pos*-2; diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index e794643132..6866750006 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -85,7 +85,7 @@ void ConcavePolygonShape2D::_bind_methods() { ClassDB::bind_method(_MD("set_segments","segments"),&ConcavePolygonShape2D::set_segments); ClassDB::bind_method(_MD("get_segments"),&ConcavePolygonShape2D::get_segments); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"segments"),_SCS("set_segments"),_SCS("get_segments") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"segments"),_SCS("set_segments"),_SCS("get_segments") ); } diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index cc3b0c063d..0d3ba238f6 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -67,7 +67,7 @@ void ConvexPolygonShape2D::_bind_methods() { - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") ); } diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 50c546b855..e201cb16ac 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -610,7 +610,7 @@ void Curve2D::_bake() const { pointlist.push_back(lastpos); baked_point_cache.resize(pointlist.size()); - Vector2Array::Write w = baked_point_cache.write(); + PoolVector2Array::Write w = baked_point_cache.write(); int idx=0; @@ -645,7 +645,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{ return baked_point_cache.get(0); int bpc=baked_point_cache.size(); - Vector2Array::Read r = baked_point_cache.read(); + PoolVector2Array::Read r = baked_point_cache.read(); if (p_offset<0) return r[0]; @@ -674,7 +674,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{ } -Vector2Array Curve2D::get_baked_points() const { +PoolVector2Array Curve2D::get_baked_points() const { if (baked_cache_dirty) _bake(); @@ -700,9 +700,9 @@ Dictionary Curve2D::_get_data() const { Dictionary dc; - Vector2Array d; + PoolVector2Array d; d.resize(points.size()*3); - Vector2Array::Write w = d.write(); + PoolVector2Array::Write w = d.write(); for(int i=0;i<points.size();i++) { @@ -713,7 +713,7 @@ Dictionary Curve2D::_get_data() const { } - w=Vector2Array::Write(); + w=PoolVector2Array::Write(); dc["points"]=d; @@ -724,11 +724,11 @@ void Curve2D::_set_data(const Dictionary& p_data){ ERR_FAIL_COND(!p_data.has("points")); - Vector2Array rp=p_data["points"]; + PoolVector2Array rp=p_data["points"]; int pc = rp.size(); ERR_FAIL_COND(pc%3!=0); points.resize(pc/3); - Vector2Array::Read r = rp.read(); + PoolVector2Array::Read r = rp.read(); for(int i=0;i<points.size();i++) { @@ -742,9 +742,9 @@ void Curve2D::_set_data(const Dictionary& p_data){ } -Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { +PoolVector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { - Vector2Array tess; + PoolVector2Array tess; if (points.size()==0) { @@ -764,7 +764,7 @@ Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { } tess.resize(pc); - Vector2Array::Write bpw=tess.write(); + PoolVector2Array::Write bpw=tess.write(); bpw[0]=points[0].pos; int pidx=0; @@ -781,7 +781,7 @@ Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { } - bpw=Vector2Array::Write (); + bpw=PoolVector2Array::Write (); return tess; @@ -1090,11 +1090,11 @@ void Curve3D::_bake() const { pointlist.push_back(Plane(lastpos,lastilt)); baked_point_cache.resize(pointlist.size()); - Vector3Array::Write w = baked_point_cache.write(); + PoolVector3Array::Write w = baked_point_cache.write(); int idx=0; baked_tilt_cache.resize(pointlist.size()); - RealArray::Write wt = baked_tilt_cache.write(); + PoolRealArray::Write wt = baked_tilt_cache.write(); for(List<Plane>::Element *E=pointlist.front();E;E=E->next()) { @@ -1128,7 +1128,7 @@ Vector3 Curve3D::interpolate_baked(float p_offset,bool p_cubic) const{ return baked_point_cache.get(0); int bpc=baked_point_cache.size(); - Vector3Array::Read r = baked_point_cache.read(); + PoolVector3Array::Read r = baked_point_cache.read(); if (p_offset<0) return r[0]; @@ -1172,7 +1172,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const{ return baked_tilt_cache.get(0); int bpc=baked_tilt_cache.size(); - RealArray::Read r = baked_tilt_cache.read(); + PoolRealArray::Read r = baked_tilt_cache.read(); if (p_offset<0) return r[0]; @@ -1196,7 +1196,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const{ } -Vector3Array Curve3D::get_baked_points() const { +PoolVector3Array Curve3D::get_baked_points() const { if (baked_cache_dirty) _bake(); @@ -1205,7 +1205,7 @@ Vector3Array Curve3D::get_baked_points() const { } -RealArray Curve3D::get_baked_tilts() const { +PoolRealArray Curve3D::get_baked_tilts() const { if (baked_cache_dirty) _bake(); @@ -1231,12 +1231,12 @@ Dictionary Curve3D::_get_data() const { Dictionary dc; - Vector3Array d; + PoolVector3Array d; d.resize(points.size()*3); - Vector3Array::Write w = d.write(); - RealArray t; + PoolVector3Array::Write w = d.write(); + PoolRealArray t; t.resize(points.size()); - RealArray::Write wt = t.write(); + PoolRealArray::Write wt = t.write(); for(int i=0;i<points.size();i++) { @@ -1247,8 +1247,8 @@ Dictionary Curve3D::_get_data() const { wt[i]=points[i].tilt; } - w=Vector3Array::Write(); - wt=RealArray::Write(); + w=PoolVector3Array::Write(); + wt=PoolRealArray::Write(); dc["points"]=d; dc["tilts"]=t; @@ -1261,13 +1261,13 @@ void Curve3D::_set_data(const Dictionary& p_data){ ERR_FAIL_COND(!p_data.has("points")); ERR_FAIL_COND(!p_data.has("tilts")); - Vector3Array rp=p_data["points"]; + PoolVector3Array rp=p_data["points"]; int pc = rp.size(); ERR_FAIL_COND(pc%3!=0); points.resize(pc/3); - Vector3Array::Read r = rp.read(); - RealArray rtl=p_data["tilts"]; - RealArray::Read rt=rtl.read(); + PoolVector3Array::Read r = rp.read(); + PoolRealArray rtl=p_data["tilts"]; + PoolRealArray::Read rt=rtl.read(); for(int i=0;i<points.size();i++) { @@ -1282,9 +1282,9 @@ void Curve3D::_set_data(const Dictionary& p_data){ } -Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { +PoolVector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { - Vector3Array tess; + PoolVector3Array tess; if (points.size()==0) { @@ -1304,7 +1304,7 @@ Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { } tess.resize(pc); - Vector3Array::Write bpw=tess.write(); + PoolVector3Array::Write bpw=tess.write(); bpw[0]=points[0].pos; int pidx=0; @@ -1321,7 +1321,7 @@ Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { } - bpw=Vector3Array::Write (); + bpw=PoolVector3Array::Write (); return tess; diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 670232c9b2..3362109354 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -103,7 +103,7 @@ class Curve2D : public Resource { }; mutable bool baked_cache_dirty; - mutable Vector2Array baked_point_cache; + mutable PoolVector2Array baked_point_cache; mutable float baked_max_ofs; @@ -145,9 +145,9 @@ public: float get_baked_length() const; Vector2 interpolate_baked(float p_offset,bool p_cubic=false) const; - Vector2Array get_baked_points() const; //useful for going thru + PoolVector2Array get_baked_points() const; //useful for going thru - Vector2Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display + PoolVector2Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display Curve2D(); @@ -179,8 +179,8 @@ class Curve3D : public Resource { }; mutable bool baked_cache_dirty; - mutable Vector3Array baked_point_cache; - mutable RealArray baked_tilt_cache; + mutable PoolVector3Array baked_point_cache; + mutable PoolRealArray baked_tilt_cache; mutable float baked_max_ofs; @@ -225,10 +225,10 @@ public: float get_baked_length() const; Vector3 interpolate_baked(float p_offset,bool p_cubic=false) const; float interpolate_baked_tilt(float p_offset) const; - Vector3Array get_baked_points() const; //useful for going thru - RealArray get_baked_tilts() const; //useful for going thru + PoolVector3Array get_baked_points() const; //useful for going thru + PoolRealArray get_baked_tilts() const; //useful for going thru - Vector3Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display + PoolVector3Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display Curve3D(); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 0464a64031..3373478336 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -599,8 +599,8 @@ void BitmapFont::_bind_methods() { ClassDB::bind_method(_MD("get_fallback"),&BitmapFont::get_fallback); ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "textures", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_textures"), _SCS("_get_textures") ); - ADD_PROPERTY( PropertyInfo( Variant::INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_chars"), _SCS("_get_chars") ); - ADD_PROPERTY( PropertyInfo( Variant::INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_kernings"), _SCS("_get_kernings") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_chars"), _SCS("_get_chars") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_kernings"), _SCS("_get_kernings") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_height"), _SCS("get_height") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_ascent"), _SCS("get_ascent") ); diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index bad87910ff..74f4e8f5f7 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -162,9 +162,9 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { } ERR_FAIL_COND_V(!d.has("aabb"),false); - AABB aabb = d["aabb"]; + Rect3 aabb = d["aabb"]; - Vector<AABB> bone_aabb; + Vector<Rect3> bone_aabb; if (d.has("bone_aabb")) { Array baabb = d["bone_aabb"]; bone_aabb.resize(baabb.size()); @@ -244,7 +244,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { d["format"]=VS::get_singleton()->mesh_surface_get_format(mesh,idx); d["aabb"]=VS::get_singleton()->mesh_surface_get_aabb(mesh,idx); - Vector<AABB> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh,idx); + Vector<Rect3> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh,idx); Array arr; for(int i=0;i<skel_aabb.size();i++) { arr[i]=skel_aabb[i]; @@ -275,7 +275,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { if (morph_targets.size()) { - p_list->push_back(PropertyInfo(Variant::STRING_ARRAY,"morph_target/names",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::POOL_STRING_ARRAY,"morph_target/names",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::INT,"morph_target/mode",PROPERTY_HINT_ENUM,"Normalized,Relative")); } @@ -286,7 +286,7 @@ void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::OBJECT,"surface_"+itos(i+1)+"/material", PROPERTY_HINT_RESOURCE_TYPE,"Material",PROPERTY_USAGE_EDITOR ) ); } - p_list->push_back( PropertyInfo( Variant::_AABB,"custom_aabb/custom_aabb" ) ); + p_list->push_back( PropertyInfo( Variant::RECT3,"custom_aabb/custom_aabb" ) ); } @@ -294,7 +294,7 @@ void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { void Mesh::_recompute_aabb() { // regenerate AABB - aabb=AABB(); + aabb=Rect3(); for (int i=0;i<surfaces.size();i++) { @@ -306,7 +306,7 @@ void Mesh::_recompute_aabb() { } -void Mesh::add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<AABB>& p_bone_aabbs) { +void Mesh::add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<Rect3>& p_bone_aabbs) { Surface s; s.aabb=p_aabb; @@ -337,7 +337,7 @@ void Mesh::add_surface_from_arrays(PrimitiveType p_primitive,const Array& p_arra const Vector3 *vtx=r.ptr(); // check AABB - AABB aabb; + Rect3 aabb; for (int i=0;i<len;i++) { if (i==0) @@ -505,7 +505,7 @@ String Mesh::surface_get_name(int p_idx) const{ } -void Mesh::surface_set_custom_aabb(int p_idx,const AABB& p_aabb) { +void Mesh::surface_set_custom_aabb(int p_idx,const Rect3& p_aabb) { ERR_FAIL_INDEX( p_idx, surfaces.size() ); surfaces[p_idx].aabb=p_aabb; @@ -522,7 +522,7 @@ Ref<Material> Mesh::surface_get_material(int p_idx) const { void Mesh::add_surface_from_mesh_data(const Geometry::MeshData& p_mesh_data) { VisualServer::get_singleton()->mesh_add_surface_from_mesh_data( mesh, p_mesh_data ); - AABB aabb; + Rect3 aabb; for (int i=0;i<p_mesh_data.vertices.size();i++) { if (i==0) @@ -551,19 +551,19 @@ RID Mesh::get_rid() const { return mesh; } -AABB Mesh::get_aabb() const { +Rect3 Mesh::get_aabb() const { return aabb; } -void Mesh::set_custom_aabb(const AABB& p_custom) { +void Mesh::set_custom_aabb(const Rect3& p_custom) { custom_aabb=p_custom; VS::get_singleton()->mesh_set_custom_aabb(mesh,custom_aabb); } -AABB Mesh::get_custom_aabb() const { +Rect3 Mesh::get_custom_aabb() const { return custom_aabb; } diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index f92db837ea..8e0b4d4e25 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -114,15 +114,15 @@ public: private: struct Surface { String name; - AABB aabb; + Rect3 aabb; Ref<Material> material; }; Vector<Surface> surfaces; RID mesh; - AABB aabb; + Rect3 aabb; MorphTargetMode morph_target_mode; Vector<StringName> morph_targets; - AABB custom_aabb; + Rect3 custom_aabb; mutable Ref<TriangleMesh> triangle_mesh; @@ -139,7 +139,7 @@ protected: public: void add_surface_from_arrays(PrimitiveType p_primitive, const Array& p_arrays, const Array& p_blend_shapes=Array(), uint32_t p_flags=ARRAY_COMPRESS_DEFAULT); - void add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<AABB>& p_bone_aabbs=Vector<AABB>()); + void add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>()); Array surface_get_arrays(int p_surface) const; virtual Array surface_get_morph_arrays(int p_surface) const; @@ -155,7 +155,7 @@ public: int get_surface_count() const; void surface_remove(int p_idx); - void surface_set_custom_aabb(int p_surface,const AABB& p_aabb); //only recognized by driver + void surface_set_custom_aabb(int p_surface,const Rect3& p_aabb); //only recognized by driver int surface_get_array_len(int p_idx) const; @@ -172,10 +172,10 @@ public: void add_surface_from_mesh_data(const Geometry::MeshData& p_mesh_data); - void set_custom_aabb(const AABB& p_custom); - AABB get_custom_aabb() const; + void set_custom_aabb(const Rect3& p_custom); + Rect3 get_custom_aabb() const; - AABB get_aabb() const; + Rect3 get_aabb() const; virtual RID get_rid() const; Ref<Shape> create_trimesh_shape() const; diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 143870c920..75df4a4e60 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -175,7 +175,7 @@ Color MultiMesh::get_instance_color(int p_instance) const { } -AABB MultiMesh::get_aabb() const { +Rect3 MultiMesh::get_aabb() const { return VisualServer::get_singleton()->multimesh_get_aabb(multimesh); @@ -237,8 +237,8 @@ void MultiMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT,"transform_format",PROPERTY_HINT_ENUM,"2D,3D"), _SCS("set_transform_format"), _SCS("get_transform_format")); ADD_PROPERTY(PropertyInfo(Variant::INT,"instance_count",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_instance_count"), _SCS("get_instance_count")); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"mesh",PROPERTY_HINT_RESOURCE_TYPE,"Mesh"), _SCS("set_mesh"), _SCS("get_mesh")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_transform_array"), _SCS("_get_transform_array")); - ADD_PROPERTY(PropertyInfo(Variant::COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_color_array"), _SCS("_get_color_array")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_transform_array"), _SCS("_get_transform_array")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_color_array"), _SCS("_get_color_array")); diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index 3ba109a087..c86b33adcf 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -85,7 +85,7 @@ public: void set_instance_color(int p_instance, const Color& p_color); Color get_instance_color(int p_instance) const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual RID get_rid() const; diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index 88648272be..069127f291 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -56,7 +56,7 @@ void RoomBounds::_bind_methods() { ClassDB::bind_method(_MD("get_geometry_hint"),&RoomBounds::get_geometry_hint); //ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), _SCS("set_bounds"),_SCS("get_bounds") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "geometry_hint"),_SCS("set_geometry_hint"),_SCS("get_geometry_hint") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_VECTOR3_ARRAY, "geometry_hint"),_SCS("set_geometry_hint"),_SCS("get_geometry_hint") ); } diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 4e2af89c05..b5a886b4b9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -47,14 +47,14 @@ real_t Shape2D::get_custom_solver_bias() const{ } -bool Shape2D::collide_with_motion(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion) { +bool Shape2D::collide_with_motion(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_shape_motion) { ERR_FAIL_COND_V(p_shape.is_null(),false); int r; return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,p_local_motion,p_shape->get_rid(),p_shape_xform,p_shape_motion,NULL,0,r); } -bool Shape2D::collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform){ +bool Shape2D::collide(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform){ ERR_FAIL_COND_V(p_shape.is_null(),false); int r; return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,Vector2(),p_shape->get_rid(),p_shape_xform,Vector2(),NULL,0,r); @@ -62,7 +62,7 @@ bool Shape2D::collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shap } -Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion){ +Variant Shape2D::collide_with_motion_and_get_contacts(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_shape_motion){ ERR_FAIL_COND_V(p_shape.is_null(),Variant()); const int max_contacts = 16; @@ -81,7 +81,7 @@ Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32& p_local_xf return results; } -Variant Shape2D::collide_and_get_contacts(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform){ +Variant Shape2D::collide_and_get_contacts(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform){ ERR_FAIL_COND_V(p_shape.is_null(),Variant()); const int max_contacts = 16; diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index ea89b31057..6a7ec03a9a 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -47,11 +47,11 @@ public: void set_custom_solver_bias(real_t p_bias); real_t get_custom_solver_bias() const; - bool collide_with_motion(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_p_shape_motion); - bool collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform); + bool collide_with_motion(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_p_shape_motion); + bool collide(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform); - Variant collide_with_motion_and_get_contacts(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_p_shape_motion); - Variant collide_and_get_contacts(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform); + Variant collide_with_motion_and_get_contacts(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_p_shape_motion); + Variant collide_and_get_contacts(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform); virtual void draw(const RID& p_to_rid,const Color& p_color) {} virtual Rect2 get_rect() const { return Rect2(); } diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index 64f3dd8b97..3f7261c312 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -41,7 +41,7 @@ struct SpatialIndexer { struct NotifierData { - AABB aabb; + Rect3 aabb; OctreeElementID id; }; @@ -64,7 +64,7 @@ struct SpatialIndexer { uint64_t pass; uint64_t last_frame; - void _notifier_add(VisibilityNotifier* p_notifier,const AABB& p_rect) { + void _notifier_add(VisibilityNotifier* p_notifier,const Rect3& p_rect) { ERR_FAIL_COND(notifiers.has(p_notifier)); notifiers[p_notifier].aabb=p_rect; @@ -73,7 +73,7 @@ struct SpatialIndexer { } - void _notifier_update(VisibilityNotifier* p_notifier,const AABB& p_rect) { + void _notifier_update(VisibilityNotifier* p_notifier,const Rect3& p_rect) { Map<VisibilityNotifier*,NotifierData>::Element *E=notifiers.find(p_notifier); ERR_FAIL_COND(!E); @@ -246,14 +246,14 @@ void World::_remove_camera(Camera* p_camera){ -void World::_register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ +void World::_register_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect){ #ifndef _3D_DISABLED indexer->_notifier_add(p_notifier,p_rect); #endif } -void World::_update_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ +void World::_update_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect){ #ifndef _3D_DISABLED indexer->_notifier_update(p_notifier,p_rect); diff --git a/scene/resources/world.h b/scene/resources/world.h index 8244261243..bea07882d7 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -60,8 +60,8 @@ friend class VisibilityNotifier; void _update_camera(Camera* p_camera); void _remove_camera(Camera* p_camera); - void _register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect); - void _update_notifier(VisibilityNotifier *p_notifier,const AABB& p_rect); + void _register_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect); + void _update_notifier(VisibilityNotifier *p_notifier,const Rect3& p_rect); void _remove_notifier(VisibilityNotifier* p_notifier); friend class Viewport; void _update(uint64_t p_frame); |