diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 47c53d7bd..0036728f9 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -7041,7 +7041,7 @@ void SpatialEditor::_register_all_gizmos() { add_gizmo_plugin(Ref(memnew(ListenerSpatialGizmoPlugin))); add_gizmo_plugin(Ref(memnew(MeshInstanceSpatialGizmoPlugin))); add_gizmo_plugin(Ref(memnew(SoftBodySpatialGizmoPlugin))); - add_gizmo_plugin(Ref(memnew(Sprite3DSpatialGizmoPlugin))); + add_gizmo_plugin(Ref(memnew(SpriteBase3DSpatialGizmoPlugin))); add_gizmo_plugin(Ref(memnew(Label3DSpatialGizmoPlugin))); add_gizmo_plugin(Ref(memnew(Position3DSpatialGizmoPlugin))); add_gizmo_plugin(Ref(memnew(RayCastSpatialGizmoPlugin))); diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 02362ca28..dbf8bbf8d 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -2064,31 +2064,31 @@ void MeshInstanceSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { } ///// -Sprite3DSpatialGizmoPlugin::Sprite3DSpatialGizmoPlugin() { +SpriteBase3DSpatialGizmoPlugin::SpriteBase3DSpatialGizmoPlugin() { } -bool Sprite3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to(p_spatial) != nullptr; +bool SpriteBase3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { + return Object::cast_to(p_spatial) != nullptr; } -String Sprite3DSpatialGizmoPlugin::get_gizmo_name() const { - return "Sprite3D"; +String SpriteBase3DSpatialGizmoPlugin::get_gizmo_name() const { + return "SpriteBase3D"; } -int Sprite3DSpatialGizmoPlugin::get_priority() const { +int SpriteBase3DSpatialGizmoPlugin::get_priority() const { return -1; } -bool Sprite3DSpatialGizmoPlugin::can_be_hidden() const { +bool SpriteBase3DSpatialGizmoPlugin::can_be_hidden() const { return false; } -void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { - Sprite3D *sprite = Object::cast_to(p_gizmo->get_spatial_node()); +void SpriteBase3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { + SpriteBase3D *sprite_base = Object::cast_to(p_gizmo->get_spatial_node()); p_gizmo->clear(); - Ref tm = sprite->generate_triangle_mesh(); + Ref tm = sprite_base->generate_triangle_mesh(); if (tm.is_valid()) { p_gizmo->add_collision_triangles(tm); } diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 1a061897e..d9404aab8 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -300,8 +300,8 @@ public: MeshInstanceSpatialGizmoPlugin(); }; -class Sprite3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - GDCLASS(Sprite3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin); +class SpriteBase3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { + GDCLASS(SpriteBase3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin); public: bool has_gizmo(Spatial *p_spatial); @@ -310,7 +310,7 @@ public: bool can_be_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); - Sprite3DSpatialGizmoPlugin(); + SpriteBase3DSpatialGizmoPlugin(); }; class Label3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index a0dd4514f..e6199df2d 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -1027,7 +1027,7 @@ Rect2 AnimatedSprite3D::get_item_rect() const { Size2 s = t->get_size(); Point2 ofs = get_offset(); - if (centered) { + if (is_centered()) { ofs -= s / 2; } diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 0d1367467..37ca6edc1 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -212,8 +212,6 @@ class AnimatedSprite3D : public SpriteBase3D { StringName animation; int frame; - bool centered; - float timeout; bool hflip;