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 System #5928

Merged
merged 191 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
d764b9e
gizmo colliison example setup
kpal81xd Dec 23, 2023
991e943
fixed bug in ray triangle intersection code
kpal81xd Dec 24, 2023
e502e39
extracted light and material creation
kpal81xd Dec 24, 2023
5ca3f36
Merged main into branch
kpal81xd Dec 24, 2023
374b406
added child transform class with axes and props in examples to change…
kpal81xd Dec 25, 2023
a570c38
added planes; added basic movement for arrows and planes
kpal81xd Dec 28, 2023
1b85ed1
fixed y plane transform movement
kpal81xd Dec 28, 2023
e4aea84
reworking intersection for gizmo transform
kpal81xd Dec 28, 2023
810be60
ported axis and plane transforms from editor gizmo code
kpal81xd Dec 29, 2023
0f85ed8
removed unused camera distance function
kpal81xd Dec 29, 2023
72a1332
removed planeaxis mapping object
kpal81xd Dec 29, 2023
e158336
renamed methods and added comments for point calc
kpal81xd Dec 29, 2023
49f5fc8
add guidlines when moving translate gizmo
kpal81xd Dec 29, 2023
969c0e2
starting setting gizmo nodes positions based on translation
kpal81xd Dec 29, 2023
41353f4
applied offsets to selected nodes and update gizmo position based on …
kpal81xd Dec 29, 2023
e479b2d
extracted guildine axes constant outside class
kpal81xd Dec 29, 2023
6140dd1
replaced new vector with reusing tmp vector
kpal81xd Dec 29, 2023
7aeb8c8
updated commented box for testing
kpal81xd Dec 29, 2023
54f26e7
added plane size setting to controls
kpal81xd Dec 29, 2023
b46ca78
comma removal
kpal81xd Dec 30, 2023
aab2101
abstracted parameters for gizmo base class
kpal81xd Dec 30, 2023
bd6bbb3
gizmo axis rotation when set coord to local
kpal81xd Jan 2, 2024
249c417
removed unused intersect
kpal81xd Jan 2, 2024
fc7a3a1
moved selection variables inside function
kpal81xd Jan 2, 2024
51d46d0
change gizmo position and rotation getters to internal setters
kpal81xd Jan 2, 2024
93b30c5
add setting in examples for coord space
kpal81xd Jan 2, 2024
c6753ae
extracted transform superclass and implemented translate and scale cl…
kpal81xd Jan 2, 2024
bb0b1f9
added all axes entity scaling and removed unused variables
kpal81xd Jan 2, 2024
837f1ea
added all axes entity scaling and removed unused variables
kpal81xd Jan 2, 2024
94e2848
removed math import
kpal81xd Jan 2, 2024
a4c205f
added camera controls and gizmo scaling for perspective
kpal81xd Jan 2, 2024
a68ae23
added fixed gizmo scaling constants for persp and otho camera
kpal81xd Jan 3, 2024
e86080d
increased guideline size ;fixed hover drag issue
kpal81xd Jan 3, 2024
b2851a4
add gizmo type changing in example; disabled drawLine update if gizmo…
kpal81xd Jan 3, 2024
6aa7455
add plane gap setting
kpal81xd Jan 3, 2024
a17a9b9
added gizmo rotation and cleaned up inherit classes
kpal81xd Jan 3, 2024
757f416
added gizmo handler to example for type switching
kpal81xd Jan 3, 2024
ca44896
added extra box in examples
kpal81xd Jan 3, 2024
1df2de8
cleaned up example and disabled set firing when switching gizmos
kpal81xd Jan 4, 2024
66426f5
add dynamic controls to gizmo example
kpal81xd Jan 4, 2024
6166267
refactor spaces and removed unused temporary vector
kpal81xd Jan 4, 2024
54ec117
added facing ring for rotation and updated colors
kpal81xd Jan 4, 2024
dc76967
refactor and renaming methods from using update to set
kpal81xd Jan 4, 2024
60c27d3
moved node updates to child classes
kpal81xd Jan 4, 2024
5974125
gizmo type switching keybinds in example
kpal81xd Jan 4, 2024
161fc97
reording detach and faceDisks happens on attach
kpal81xd Jan 4, 2024
2b9f849
fixed rotation issue when gizmo not at origin
kpal81xd Jan 4, 2024
2840ec5
update facing disk when changing coord space
kpal81xd Jan 4, 2024
b903482
added snapping for translate rotate and scale
kpal81xd Jan 4, 2024
7bd6618
added plane flipping when viewing from underneath; changed coordSpace…
kpal81xd Jan 5, 2024
d7dcff9
added missing flipAxis for plane flipping
kpal81xd Jan 5, 2024
5d142da
moved plane array initialize and added create transform in ctor
kpal81xd Jan 5, 2024
3fc2074
fixed axis plane gap getter
kpal81xd Jan 5, 2024
468ddf2
renamed dirtyElement to hoverElement
kpal81xd Jan 5, 2024
4a8b4ce
added check for plane flip on attach override
kpal81xd Jan 5, 2024
e72c103
refactored example code
kpal81xd Jan 5, 2024
c666a01
customization for gizmo colors
kpal81xd Jan 5, 2024
8bc5a88
added semi colons to end of import
kpal81xd Jan 5, 2024
7f0e1a6
hoisted temporary vectors outside methods
kpal81xd Jan 6, 2024
5287af4
removed commented lighting code
kpal81xd Jan 6, 2024
4d91585
changed getter and setter to use color object instead of array
kpal81xd Jan 6, 2024
1374f18
replaced overrides with events for attach and detach.
kpal81xd Jan 7, 2024
1526b36
renamed elements to shapes and made private
kpal81xd Jan 7, 2024
ce35e10
moved predefined attributes to class body
kpal81xd Jan 7, 2024
43848ed
moved all axis shapes to separate file
kpal81xd Jan 7, 2024
eb5cb09
removed VEC3_AXIS
kpal81xd Jan 7, 2024
cfdb59c
reordered methods in gizmo base class
kpal81xd Jan 7, 2024
12578a3
check if gizmo enabled on snapping check
kpal81xd Jan 7, 2024
c7dae17
refactored update methods and added events firing for each
kpal81xd Jan 7, 2024
a7b0b31
moved snapping to gizmo transform; made update pos rot and scale priv…
kpal81xd Jan 7, 2024
2b80441
changed internal coordSpace to protected
kpal81xd Jan 7, 2024
d691cd3
removed line drawing from gizmo layer and renamed to layer.
kpal81xd Jan 7, 2024
03ae63a
Merge branch 'main' into gizmos
kpal81xd Jan 7, 2024
647344e
removed unnecessary vec creation in updateLine
kpal81xd Jan 8, 2024
fbab09a
and segments and sides to rotate rings
kpal81xd Jan 8, 2024
2e8fccb
replaced segment and side settings with ratios to each radius
kpal81xd Jan 8, 2024
5405573
window define to update react state using keybinds
kpal81xd Jan 8, 2024
40e31af
Merge branch 'main' into gizmos
kpal81xd Jan 8, 2024
23e4a4f
removed tube radius ratio (minimal noticable effect)
kpal81xd Jan 8, 2024
cb6b912
added face tube and ring radius settings and fixed segments
kpal81xd Jan 8, 2024
bc60fc1
Merge branch 'main' into gizmos
kpal81xd Jan 8, 2024
18647f6
added hover and guide line color customization
kpal81xd Jan 8, 2024
19de376
refactor gizmo-transform getters/setters
kpal81xd Jan 8, 2024
bb3d1ea
spread argument refactor
kpal81xd Jan 8, 2024
4abaeb8
refactor axis to xyz for radii names
kpal81xd Jan 8, 2024
a1ea4c7
formatted color property names and organised controls in example
kpal81xd Jan 8, 2024
1426551
added jsdoc to transform and refactored attribute names and changed v…
kpal81xd Jan 8, 2024
99b5c66
rename entity mesh root
kpal81xd Jan 8, 2024
fa5b2dd
refactor shapeMap
kpal81xd Jan 8, 2024
432dcff
refactored axisShape to shape
kpal81xd Jan 8, 2024
53742f6
refactor propName to prop
kpal81xd Jan 8, 2024
938aeb6
added jsdoc to translate rotate and scale classes
kpal81xd Jan 8, 2024
53990cd
added snap increment setting
kpal81xd Jan 8, 2024
2cf38d9
fixed potential division by zero
kpal81xd Jan 8, 2024
861a923
fixed updateScale issue and added jsdoc
kpal81xd Jan 8, 2024
40419d7
used camera component instead of camera entity
kpal81xd Jan 8, 2024
37f8dae
removed check for flip; used material culling
kpal81xd Jan 8, 2024
09b17d4
Merge branch 'main' into gizmos
kpal81xd Jan 9, 2024
b94a0c9
fixed accidental axis color switch
kpal81xd Jan 9, 2024
98edd5d
renamed cull materials
kpal81xd Jan 9, 2024
33bdd9a
jsdoc update for materials
kpal81xd Jan 9, 2024
35a8419
removed unused vector in gizmo scale
kpal81xd Jan 9, 2024
4706dfb
add uniform scaling on planes
kpal81xd Jan 9, 2024
6778a8b
Merge branch 'main' into gizmos
kpal81xd Jan 9, 2024
fa6b43b
updated unform scaling to use length
kpal81xd Jan 9, 2024
6643e2d
added fly controls; added update scale to app update
kpal81xd Jan 9, 2024
63ed2ed
added cull none material for hovering
kpal81xd Jan 9, 2024
74f4976
removed guidline disk and facing disk set on app update
kpal81xd Jan 9, 2024
9025b00
fixed local rotation stuttering issue
kpal81xd Jan 9, 2024
1a6b93e
fixed facing axis rotation
kpal81xd Jan 9, 2024
01498b3
added rotate angle guide line; hover cleanup on detach
kpal81xd Jan 9, 2024
b8d60b4
Merge branch 'main' into gizmos
kpal81xd Jan 9, 2024
f17da1e
rename of offset to delta
kpal81xd Jan 9, 2024
43f35c1
transform event cleanup; angle guide line now match axis colors
kpal81xd Jan 9, 2024
cbfdb22
fixed guide line angle colors
kpal81xd Jan 9, 2024
c2d7446
set guide line angle color to black
kpal81xd Jan 9, 2024
8867036
fixed face rotation and added its guide line for angle
kpal81xd Jan 9, 2024
8ae4dae
refactored camera rotation quaternion
kpal81xd Jan 9, 2024
a2c2299
entity fix for camera rotation
kpal81xd Jan 9, 2024
e9de076
added lighting to meshes; hoisted ray intersection function
kpal81xd Jan 10, 2024
01b1c5c
changed rotate guide line to hover color
kpal81xd Jan 10, 2024
f480584
made axes colors semi transparent
kpal81xd Jan 10, 2024
7d547a4
refactoring of unused variable in createShadowMesh
kpal81xd Jan 10, 2024
9c9b965
Merge branch 'main' into gizmos
kpal81xd Jan 10, 2024
0de825e
fixed entity transform for shadow to use correct entity
kpal81xd Jan 10, 2024
7e86045
color constants rename
kpal81xd Jan 10, 2024
88a973d
updated rotation rings to be arcs for rotation
kpal81xd Jan 11, 2024
9a87c73
extracted camera position for look at functions
kpal81xd Jan 11, 2024
d1198fd
updated face disk size
kpal81xd Jan 11, 2024
ba233ba
added full circle when dragging and hiding of other axes
kpal81xd Jan 11, 2024
5d183af
fixed guide angle rotation for local space
kpal81xd Jan 11, 2024
f16f942
refactored all colors; removed excess color settings
kpal81xd Jan 11, 2024
fbb6af6
added alias for gizmoRot in draw guide lines
kpal81xd Jan 11, 2024
7433615
inverted uniform keybind
kpal81xd Jan 11, 2024
9e02209
hoisted guideAngleEnd
kpal81xd Jan 11, 2024
377558e
added guide colors object
kpal81xd Jan 11, 2024
04403f9
added separation between intersection and render meshes
kpal81xd Jan 11, 2024
7054a3e
intersect meshInstance using tmp material
kpal81xd Jan 11, 2024
3d6d02a
fixed lighting issue on outer disk; prepping for triangle intersection
kpal81xd Jan 12, 2024
5aa0381
extracted ray intersection code into tri class
kpal81xd Jan 12, 2024
0b1dcd5
tri class for ray intersection
kpal81xd Jan 12, 2024
d7f5fd2
modified intersection code to use triangles
kpal81xd Jan 12, 2024
394319d
fixed linting issue
kpal81xd Jan 12, 2024
785811e
added check for window for event listeners
kpal81xd Jan 12, 2024
61d7115
Merge branch 'main' into gizmos
kpal81xd Jan 14, 2024
0763f63
removed todo
kpal81xd Jan 14, 2024
3421da7
created variables for magic numbers
kpal81xd Jan 14, 2024
4726b44
extracted mesh tri data into new class
kpal81xd Jan 15, 2024
ede29c1
Merge branch 'main' into gizmos
kpal81xd Jan 15, 2024
f412fdf
Removed unused code in tri class
kpal81xd Jan 16, 2024
f95918d
Merge branch 'gizmos' of https://github.com/playcanvas/engine into gi…
kpal81xd Jan 16, 2024
cc6edfb
removed unused vectors in tri class
kpal81xd Jan 16, 2024
fc7fe03
removed bloat vec3 and array ctor override for tri class
kpal81xd Jan 16, 2024
781610d
removed vec3 creation in intersectRay
kpal81xd Jan 16, 2024
e6a22e7
updated jsdoc for ptm
kpal81xd Jan 16, 2024
3791fa7
extracted layer outside gizmo class; fixed tri set issue
kpal81xd Jan 16, 2024
3c58750
removed unused variables in gizmo class
kpal81xd Jan 16, 2024
fd87815
used constants for world and local space
kpal81xd Jan 16, 2024
307812b
moved event handlers to ctor and added dtor for event handler and giz…
kpal81xd Jan 16, 2024
d3061c4
removed get/set uvs from shadow mesh creation
kpal81xd Jan 16, 2024
cfb58e3
moved repeated methods to base class in axis-shapes
kpal81xd Jan 16, 2024
377e267
destroy handler for tri mesh and shapes
kpal81xd Jan 16, 2024
b3646de
hover plane now shows plane axis over facing axis
kpal81xd Jan 17, 2024
9952eea
replaced fly camera with orbit; removed distance control
kpal81xd Jan 17, 2024
68a6586
Fixed rotate lighting and added starting guide angle line
kpal81xd Jan 17, 2024
7d3c020
Updated guide angle start color and jsdoc type
kpal81xd Jan 17, 2024
439cbd0
Fixed jsdoc type for guide angle start color
kpal81xd Jan 17, 2024
1623cab
reverted default transform in example to translate
kpal81xd Jan 17, 2024
2e69cf0
modified selection to sort by camera distance
kpal81xd Jan 17, 2024
b995fd3
added intersection tolerance as control setting
kpal81xd Jan 17, 2024
84cbaa6
added center tolerance; fixed center material overlap
kpal81xd Jan 17, 2024
cff0190
Merge branch 'main' into gizmos
kpal81xd Jan 17, 2024
3ef00de
added new rotation logic; modified guide line angle calculation
kpal81xd Jan 17, 2024
c09416e
cleaned up example and prepared for picker
kpal81xd Jan 18, 2024
1f4dfa2
renamed legacyRotation to useLegacyRotation
kpal81xd Jan 18, 2024
bbee0a4
use legacy rotation when axis almost parallel to camera forward axis
kpal81xd Jan 18, 2024
dd6ee7a
added picker to example and make design like editor viewport
kpal81xd Jan 18, 2024
dafcc83
Fixed lighting; changed local rotation of multiple nodes to follow la…
kpal81xd Jan 18, 2024
4b640c2
removed legacy rotation
kpal81xd Jan 18, 2024
450aa17
updated parameters for createTorus in core engine
kpal81xd Jan 18, 2024
da96b04
updated jsdoc
kpal81xd Jan 18, 2024
de63511
fixed scale warping on global rotation of inverted scale objects.
kpal81xd Jan 19, 2024
e3ea897
changed torus sectorAngle to be degrees
kpal81xd Jan 19, 2024
f14a420
updated jsdoc for createTorus
kpal81xd Jan 19, 2024
6fbc80b
Merge branch 'main' into gizmos
kpal81xd Jan 19, 2024
cce21d1
moved deg to rad conversion to variable initializer
kpal81xd Jan 19, 2024
0bf7974
snapping on load fix
kpal81xd Jan 19, 2024
5fe43f7
hidden coordspace for scaling
kpal81xd Jan 19, 2024
5b44642
disabled webgpu for example
kpal81xd Jan 19, 2024
6f62963
Fixed picker resizing selection issue
kpal81xd Jan 19, 2024
9f9cfc1
removed orthoHeight setting; set in orbit camera
kpal81xd Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/src/examples/misc/gizmos.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function controls({ observer, ReactPCUI, React, jsx, fragment }) {
jsx(BooleanInput, {
type: 'toggle',
binding: new BindingTwoWay(),
link: { observer, path: 'gizmo.legacyRotation' }
link: { observer, path: 'gizmo.useLegacyRotation' }
kpal81xd marked this conversation as resolved.
Show resolved Hide resolved
})
)
),
Expand Down Expand Up @@ -270,7 +270,7 @@ async function example({ canvas, deviceType, data, glslangPath, twgslPath, scrip
type: type,
size: gizmo.size,
snapIncrement: gizmo.snapIncrement,
legacyRotation: gizmo.legacyRotation,
useLegacyRotation: gizmo.useLegacyRotation,
xAxisColor: Object.values(gizmo.xAxisColor),
yAxisColor: Object.values(gizmo.yAxisColor),
zAxisColor: Object.values(gizmo.zAxisColor),
Expand Down
4 changes: 2 additions & 2 deletions extras/gizmo/gizmo-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class GizmoTransform extends Gizmo {
*
* @type {boolean}
*/
legacyRotation = false;
useLegacyRotation = false;

/**
* Creates a new GizmoTransform object.
Expand Down Expand Up @@ -434,7 +434,7 @@ class GizmoTransform extends Gizmo {
// calculate angle
let angle = 0;
if (isRotation) {
if (this.legacyRotation || isFacing) {
if (this.useLegacyRotation || isFacing) {
switch (axis) {
case 'x':
angle = Math.atan2(point.z, point.y) * math.RAD_TO_DEG;
Expand Down