Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gizmo cleanup and bug fixes #6323

Merged
merged 35 commits into from
Apr 30, 2024
Merged

Gizmo cleanup and bug fixes #6323

merged 35 commits into from
Apr 30, 2024

Conversation

kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented Apr 30, 2024

Fixes #6262

  • Split calcPoint into separate overloads for each subclass (and renamed to screenToPoint
  • Replaced custom ray plane intersection with built in shapes
  • Cleaner code for rotation calculation (facing and non-facing)
  • Fixed facing guide angle rotation bug
  • Fixed orthographic local space rotation bug
  • Updated render materials when modifying colorAlpha
  • Updated lighting for example
  • Added instructions to example
  • Persistent coordSpace on changing gizmo types
  • Updated MeshTriData class to extract triangles from geometry (moved tri extraction to geometry and renamed class to TriData)

Preview

image

@kpal81xd kpal81xd self-assigned this Apr 30, 2024
@kpal81xd kpal81xd marked this pull request as draft April 30, 2024 13:28
@kpal81xd kpal81xd marked this pull request as ready for review April 30, 2024 15:06
@kpal81xd kpal81xd requested review from a team and mvaligursky April 30, 2024 15:06
@willeastcott
Copy link
Contributor

There's no public API changes with this PR, right?

@kpal81xd
Copy link
Contributor Author

There's no public API changes with this PR, right?

No it was just the calculateTris which was removed

@kpal81xd kpal81xd merged commit e7cd997 into main Apr 30, 2024
7 checks passed
@kpal81xd kpal81xd deleted the gizmo-refactor branch April 30, 2024 17:19
slimbuck pushed a commit to slimbuck/engine that referenced this pull request May 20, 2024
* WIP: reworking calcPoint code

* fixed ray and plane intersection direction issue

* WIP calcPoint cleanup for gizmo

* split up different point calculatoin into branches in calcPoint

* removed unused point rotation code

* extracted scale and rotation calcPoint into their own classes

* removed excess tmp vector

* extracted out project to line code

* updated normal calc code

* cleaned up rotation facing calculation

* updated lighting in example

* updated facing epsilon to threshold

* modified base class calcPoint

* fixed gizmo local rotation when orthographic

* removed unused variables in gizmo-transform and renamed internal properties

* made sure to update mesh materials with new colorAlpha

* renamed calcPoint

* reused same ray and plane objects for _screenToPoint

* removed extra variables created

* added instruction keybinds and maintained coordspace when switching gizmos

* extracted triangles directly from geometry

* moved tris generation to inside geometry

* Update src/extras/gizmo/rotate-gizmo.js

Co-authored-by: Will Eastcott <will@playcanvas.com>

* cleaned up comments and variables

* space refactor

* moved calculateTris back into tri data class

* fixed linting issue

* fixed scale invariant for gizmo and set device maxPixelRatio

* removed unused code

---------

Co-authored-by: Will Eastcott <will@playcanvas.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify Gizmo code geometry generation
3 participants