|
|
@@ -38,8 +38,9 @@ namespace AtomicEditor
|
|
|
{
|
|
|
|
|
|
|
|
|
-Gizmo3D::Gizmo3D(Context* context) : Object(context),
|
|
|
- dragging_(false)
|
|
|
+ Gizmo3D::Gizmo3D(Context* context) : Object(context),
|
|
|
+ dragging_(false),
|
|
|
+ cloning_(false)
|
|
|
{
|
|
|
ResourceCache* cache = GetSubsystem<ResourceCache>();
|
|
|
|
|
|
@@ -184,6 +185,16 @@ void Gizmo3D::Use()
|
|
|
Ray cameraRay = view3D_->GetCameraRay();
|
|
|
float scale = gizmoNode_->GetScale().x_;
|
|
|
|
|
|
+ // Clones an object when it's dragged while holding down Shift
|
|
|
+ bool dragShift = input->GetMouseButtonDown(MOUSEB_LEFT) && input->GetKeyDown(KEY_SHIFT);
|
|
|
+
|
|
|
+ if (dragShift && !cloning_)
|
|
|
+ {
|
|
|
+ cloning_ = true;
|
|
|
+ selection_->Copy();
|
|
|
+ selection_->Paste();
|
|
|
+ }
|
|
|
+
|
|
|
// Recalculate axes only when not left-dragging
|
|
|
bool drag = input->GetMouseButtonDown(MOUSEB_LEFT);// && (Abs(input->GetMouseMoveX()) > 3 || Abs(input->GetMouseMoveY()) > 3);
|
|
|
if (!drag)
|
|
|
@@ -193,6 +204,11 @@ void Gizmo3D::Use()
|
|
|
scene_->SendEvent(E_SCENEEDITEND);
|
|
|
dragging_ = false;
|
|
|
}
|
|
|
+
|
|
|
+ if (cloning_)
|
|
|
+ {
|
|
|
+ cloning_ = false;
|
|
|
+ }
|
|
|
|
|
|
CalculateGizmoAxes();
|
|
|
}
|