SceneView.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. TODO:
  2. - Core thread gets stuck on shutdown when OpenGL is used...Somewhere in kernel
  3. GIZMO TODO:
  4. - 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?)
  5. TESTING:
  6. Ensure all 3 render systems compile and run
  7. - Test selection on all 3 render systems
  8. - RE-ENABLE SCISSOR TEST FOR PICKING SHADERS!!
  9. - Picking need to test something with alpha
  10. - Ensure that selecting an item in scene properly marks it in scene view
  11. - Ensure that selecting an item in scene or resource tree view properly updates Selection
  12. Test gizmos
  13. - START UP GIZMO MANAGER SOMEWHERE
  14. - Test rendering of basic 2D and 3D gizmos
  15. - Test rendering of icon gizmos
  16. - Test them all from C#
  17. - HOOK UP GIZMO SELECTION and test it
  18. Test handles
  19. - Test basic move handle
  20. - Test a custom handle from C#
  21. - FINISH HANDLE IMPLEMENTATION AND GLUE EVERYTHING TOGHETHER
  22. IMPLEMENT SELECTION RENDERING
  23. IMPROVE SceneGrid LOOK AND ENSURE IT RENDERS FINE ON ALL APIS
  24. - LIKELY USE PIXEL SceneGrid WITH AA
  25. LATER:
  26. - Need a way to render text for gizmos and handles, and in scene in general
  27. - Add drag to select
  28. ----------------------------------------------------------------------
  29. Handles
  30. SliderLine - position, direction, length
  31. - When initially activated it records position nearest so the line as the starting point
  32. - Further mouse dragging also finds nearest position to the line
  33. - Difference between those two results in a float value (how much to move along direction from position to reach new position)
  34. - Slider line has a capsule + sphere collider size of which can be set manually
  35. SliderPlane - position, normal, size
  36. - Similar to line slider only the direction is determined dynamically as well as distance
  37. - Outputs a Vector2 (direction * distance moved)
  38. - A OOB is used as a collider
  39. SliderDisc - position, normal, radius
  40. - When initially activated it records position nearest so the disc as the starting point
  41. - Further movement calculates the dynamic direction from the starting point to the current point on the plane the disc lies on
  42. - Distance along that direction is returned as amount of movement (similar to line slider)
  43. - Outputs a single float
  44. - A torus is used as a collider
  45. Free move/rotate/scale handles need to exist as well
  46. - Scale is easy, just perform uniform scale. Use SliderPlane oriented towards camera
  47. - Move also use SliderPlane oriented towards camera
  48. - Rotation use SliderDisc oriented towards camera
  49. ----------------------------------------------------
  50. STAGE 1
  51. CONCRETE TODO:
  52. HandleSliderPlane/HandleSliderDisc
  53. - update() implementation
  54. ScriptHandleManager
  55. - Needs to be started up somewhere
  56. SceneEditorWidget
  57. - Need to glue everything together
  58. ----------------------------------------------------
  59. STAGE 2
  60. Implement RotateHandle & ScaleHandle in C#
  61. - Nearest point to disc/arc code
  62. Add free move, free rotate, free scale functionality
  63. Handles that remain the same size regardless of distance from camera
  64. - For both drawing and collision
  65. More complex types for drawing like DrawArrow in HandleDrawManager
  66. ----------------------------------------------------------------------
  67. SelectionRenderer
  68. Retrieve a list of selected objects from SelectionManager
  69. Find ones with Renderable components
  70. Retrieve Meshes, and world transforms from them
  71. Draw that same mesh with either a wireframe or a grayed out shader with a slight depth bias
  72. ----------------------------------------------------------------------
  73. SceneView editor flow:
  74. Hook up gizmo, handle and selection rendering methods to be executed after the scene is rendered
  75. Calculate mouse coords manually relative to the window and to the render texture GUI element
  76. - Don't use GUI events as we require more precise control (do we?)
  77. Detect mouse clicks on the scene render target
  78. Forward those mouse coordinates to HandleManager
  79. It checks if screen ray intersects any handles and returns the handle if it does
  80. If handle is found it is activated and method returns
  81. Otherwise we mark the coordinates as selection start
  82. Detect mouse drag on the scene render target
  83. - If we have an active handle
  84. Forward mouse coordinates to the active handle so it can do its thing
  85. return
  86. - Otherwise its assumed we are dragging a selection
  87. Update selection endpoint and send it to ScenePicking
  88. Use Selection to select picked objects if any
  89. return
  90. Detect mouse release on scene render target
  91. If we have an active handle
  92. Clear active handle
  93. return
  94. Otheriwse its assumed we are dragging a selection
  95. Do nothing
  96. return