defold / defold

Defold is a completely free to use game engine for development of desktop, mobile and web games.
https://www.defold.com
Other
4.08k stars 292 forks source link

Bounding box of the rotated object is invalid in the Editor #5253

Open notbadgun opened 3 years ago

notbadgun commented 3 years ago

Expected behaviour

The rotated object shouldn’t be selected when I clicked on it outside of the visible bounding box.

Actual behaviour

Steps to reproduce

defold_editor_bg1


Build time2020-09-28T10:12:41.523768
Defold channeleditor-alpha
Defold editor shad429a186416e1b0fce254b7e4379d5802de060d9
Defold engine shafe2b689302e79b7cf8c0bc7d934f23587b268c8a
Defold version1.2.173
GPUGeForce GTX 1080 Ti/PCIe/SSE2
GPU Driver4.6.0 NVIDIA 446.14
Java version11.0.1+13
OS archamd64
OS nameWindows 10
OS version10.0
AGulev commented 6 months ago

Copy from https://github.com/defold/defold/issues/3862 :

The reason is that we currently treat the aabb as a 3d box (-1 -1 -1)-(1 1 1) so for instance rotating a box around Y (up to 45) will of course make it grow in X. We always render the box as a flat (2d) rectangle.

TODO:

Respect the physics type (2d/3d) when drawing and for aabb Mimic the engine support for collision objects. For instance, when using 2d physics the engine only respects rotations around Z.