SceneView.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. TODO:
  2. - Core thread gets stuck on shutdown when OpenGL is used...Somewhere in kernel
  3. CONCRETE TASK:
  4. - Hook up gizmo manager to ScenePicking so gizmos are considered when picking
  5. - I'll likely need to update GizmoManager so I can query gizmo SceneObject based on gizmo index
  6. - Selection/ScenePicking/GizmoManager need to be started
  7. IMMEDIATE:
  8. - SceneGrid is very ugly. Consider using default lines for now and come back with a better approach later.
  9. - Potentially enable line AA?
  10. - Picking code is completely untested and will likely need major fixing
  11. - Test all the new DrawHelper3D methods
  12. GIZMO TODO:
  13. - Figure out how to deal with builtin components like Camera and Renderable (e.g. how will they have gizmos since they're not managed components?)
  14. LATER:
  15. - Need a way to render text for gizmos and handles, and in scene in general
  16. ----------------------------------------------------------------------
  17. Handles
  18. SliderLine - position, direction, length
  19. - When initially activated it records position nearest so the line as the starting point
  20. - Further mouse dragging also finds nearest position to the line
  21. - Difference between those two results in a float value (how much to move along direction from position to reach new position)
  22. - Slider line has a capsule + sphere collider size of which can be set manually
  23. SliderPlane - position, normal, size
  24. - Similar to line slider only the direction is determined dynamically as well as distance
  25. - Outputs a Vector2 (direction * distance moved)
  26. - A OOB is used as a collider
  27. SliderDisc - position, normal, radius
  28. - When initially activated it records position nearest so the disc as the starting point
  29. - Further movement calculates the dynamic direction from the starting point to the current point on the plane the disc lies on
  30. - Distance along that direction is returned as amount of movement (similar to line slider)
  31. - Outputs a single float
  32. - A torus is used as a collider
  33. Free move/rotate/scale handles need to exist as well
  34. - Scale is easy, just perform uniform scale. Use SliderPlane oriented towards camera
  35. - Move also use SliderPlane oriented towards camera
  36. - Rotation use SliderDisc oriented towards camera
  37. ----------------------------------------------------
  38. STAGE 1
  39. CONCRETE TODO:
  40. HandleSliderManager
  41. - Detecting input and updating the sliders
  42. - isHandleActive
  43. ScriptHandleManager
  44. - Needs to be started up somewhere
  45. SceneEditorWidget
  46. - Need to glue everything together
  47. ----------------------------------------------------
  48. STAGE 2
  49. Implement RotateHandle & ScaleHandle in C#
  50. - Nearest point to disc/arc code
  51. Add free move, free rotate, free scale functionality
  52. Handles that remain the same size regardless of distance from camera
  53. - For both drawing and collision
  54. More complex types for drawing like DrawArrow in HandleDrawManager
  55. ----------------------------------------------------------------------
  56. SelectionRenderer
  57. Retrieve a list of selected objects from SelectionManager
  58. Find ones with Renderable components
  59. Retrieve Meshes, and world transforms from them
  60. Draw that same mesh with either a wireframe or a grayed out shader with a slight depth bias
  61. ----------------------------------------------------------------------
  62. SceneView editor flow:
  63. Hook up gizmo, handle and selection rendering methods to be executed after the scene is rendered
  64. Calculate mouse coords manually relative to the window and to the render texture GUI element
  65. - Don't use GUI events as we require more precise control (do we?)
  66. Detect mouse clicks on the scene render target
  67. Forward those mouse coordinates to HandleManager
  68. It checks if screen ray intersects any handles and returns the handle if it does
  69. If handle is found it is activated and method returns
  70. Otherwise we mark the coordinates as selection start
  71. Detect mouse drag on the scene render target
  72. - If we have an active handle
  73. Forward mouse coordinates to the active handle so it can do its thing
  74. return
  75. - Otherwise its assumed we are dragging a selection
  76. Update selection endpoint and send it to ScenePicking
  77. Use Selection to select picked objects if any
  78. return
  79. Detect mouse release on scene render target
  80. If we have an active handle
  81. Clear active handle
  82. return
  83. Otheriwse its assumed we are dragging a selection
  84. Do nothing
  85. return