frostoven/Cosmosis

Allow mouse-based rotation for 3D and 4D objects in debugger

aggregate1166877 opened this issue · 2 comments

Details:
Following #101 (Create visual debugging interface), add special functionality for Vector3, Quaternion, and Euler objects.

When these are inspected, the user should have the option rotate a 3D object in a separate canvas, which then changes 3D or 4D values in real-time. This will allow for much faster debugging with these types.

Accidentally sent #105 commits to #101. History is at the bottom of #101.

Task complete. You can now use a cube to change values.

A limitation (feature?) encountered is that Three.js resets the cube values if exceeding a certain value. My guess is that it's being normalized. This means that the cube-based editor effectively only works for setting normalized values.

How to test:

  • Press F12 to open DevTools.
  • Run $cosmDbg.showUI()
  • Go to somewhere with multi-dim values (ex. Player -> Camera).
  • Supported values have a sphere icon on the right - click it.
  • You can now drag the cube to set values (or change the values, and the cube will update).

While dragging the cube, there are some tools to aid with dragging:

  • Hold shift to slow down drag speed for fine-control.
  • Hold an axis to rotate along that axis only (x, y, and z are supported (should probably have added w for the lolz)).

Preview:

image