Overload icon indicating copy to clipboard operation
Overload copied to clipboard

Object scale shouldn't influence gizmo translation

Open adriengivry opened this issue 5 years ago • 1 comments

Description When an object is child of a scaled object, its translation speed using gizmo is affect

To Reproduce Steps to reproduce the behavior:

  1. Create an empty GameObject
  2. Create a cube, child of the previous GameObject
  3. Scale the empty GameObject to 0.1
  4. Move the cube using the translation gizmo
  5. Notice the issue (Slow translation)

Expected behavior The translation gizmo behaviour shouldn't consider the scale of the object

adriengivry avatar Jun 07 '20 20:06 adriengivry

The problem here is that 1 unit in local space is different from 1 unit in world space. In our current implementation of Gizmos, we are moving objects in the space with unit coefficient instead of using raycasts.

Here is how we move our translated object: m_target->transform.SetLocalPosition(originPosition + GetRealDirection() * translationCoefficient); We should have some kind of SetWorldPosition to bypass the local space. We should also add SetWorldRotation and SetWorldScale. I'll open another issue for this new methods to implement.

Quick illustration of the problem: image

adriengivry avatar Jun 09 '20 22:06 adriengivry