Commit graph

96 commits

Author SHA1 Message Date
David Back
51b55aedcf CR changes, fix colors, add minimum overlay dimensions for HMD 2018-02-06 16:07:46 -08:00
David Back
ececd1c60f fix loop index change 2018-02-02 17:14:48 -08:00
David Back
ed4cbe2679 fix fill ring rotation 2018-02-02 17:05:25 -08:00
David Back
900669d937 fix multi-selection rotation yay! 2018-02-02 16:44:59 -08:00
David Back
55f55cd78b few more updates 2018-02-01 17:59:38 -08:00
David Back
db56246cd6 more fixes, clean up, updates 2018-02-01 17:30:56 -08:00
David Back
c01790bd3e punch list updates and various fixes 2018-01-31 18:27:15 -08:00
David Back
e679b75e99 fix degree display position 2018-01-29 19:02:36 -08:00
David Back
2f0d92c3cd ctrl 22.5 snapping 2018-01-29 18:15:01 -08:00
David Back
9ee7153641 fix scale speed, fix stretch panels, fix scale cube highlight 2018-01-29 16:53:02 -08:00
David Back
c4359de859 entity edit tools wip update 2018-01-19 18:20:36 -08:00
David Back
26bf78fb5d first pass new entity selection edit tools wip 2018-01-17 18:30:31 -08:00
Daniela
ef49aa0b71 Refactor to comply with code standard. 2017-11-29 18:54:08 +00:00
Daniela
8985acd8b6 YAW ROLL PITCH tool now represents angles in a usefull way. Refactoring. 2017-11-29 13:00:36 +00:00
Daniela
68d5d600b7 YAW ROLL PITCH tool gizmos + functionality 2017-11-28 23:16:34 +00:00
Daniela
eb0d925091 YAW ROLL PITCH tool gizmos + functionality 2017-11-28 22:55:09 +00:00
Daniela
123f898f80 Merge branch 'master' of https://github.com/highfidelity/hifi into Gizmos 2017-11-28 15:38:30 +00:00
luiscuenca
7dfdc8da59 Redesign and clean of unused lineWidths 2017-11-09 17:50:38 -07:00
Daniela
2ceba76ba2 yaw tool 2017-10-27 11:28:44 +01:00
Daniela
a1110bf28d Rotations now happen using the correct axis taking into account the avatar referential 2017-10-26 16:52:58 +01:00
Daniela
f15038c54f Re-add isFacingAvatar to true and delete rotation of the grabbermoveup tool. 2017-10-23 19:11:32 +01:00
Daniela
a02ee5b7d5 Grabber Tool Move up, remove billboard on grabbermoveupoverlay 2017-10-19 18:05:51 +01:00
Atlante45
6dd49f5c32 Merge branch 'stable' of https://github.com/highfidelity/hifi into new-master 2017-10-10 16:53:34 -07:00
LaShonda Hopper
2f082d9e86 [Case 6491] Fixes issue in normalizeDegrees from last commit (details below).
The range of the function is targeting (-180, 180] such that
the statement:
    if (degrees < -180)
should be:
    if (degrees <= -180)
to account for degrees being -180.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-06 10:11:26 -04:00
LaShonda Hopper
707569b230 [Case 6491] More efficient version of normalizeDegrees function (details below).
Refactoring the original normalizeDegrees function to be
more efficient as suggested via:
    https://github.com/highfidelity/hifi/pull/11338#pullrequestreview-67520585

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-06 09:50:24 -04:00
druiz17
347645329e fixing laser staying on in edit mode 2017-10-05 09:11:02 -07:00
LaShonda Hopper
18d884f6c4 [Case 6491] eslint pass: Fixes no-multiple-empty-lines issues.
* eslint pass using .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-04 20:51:06 -04:00
LaShonda Hopper
e9ae2099f3 [Case 6491] eslint pass: Fixes indent issues.
* eslint pass using .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-04 20:37:57 -04:00
LaShonda Hopper
ac81b22cc9 [Case 6491] eslint pass: Fixes references to SelectionManager (details below).
SelectionManager was being referred to as selectionManager.

* eslint pass used .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-04 20:24:20 -04:00
LaShonda Hopper
a5b913a8b9 [Case 6491] Fixes minor spacing issue, on while loop missed previous eslint pass.
Changes Committed:
    modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-04 17:36:28 -04:00
LaShonda Hopper
cb264b5552 [Case 6491] eslint pass: Addresses curly bracket, keyword spacing issues.
* eslint pass using .eslintrc.js

Changes Committed:
  modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-02 13:28:43 -04:00
LaShonda Hopper
97ecf84f3d [Case 6491] eslint pass: Cleaning up comma-dangle noise.
* eslint pass using .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-02 13:21:10 -04:00
LaShonda Hopper
c131686f1b [Case 6491] eslint pass: Addressing some comment issues.
* This should reduces the noise for the eslint passes on this script.
* eslint pass using .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-02 12:55:51 -04:00
LaShonda Hopper
a610946af1 [Case 6491] eslint pass: fixes undefined center var in that.updateHandles.
* eslint pass using .eslintrc.js

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-02 12:31:10 -04:00
LaShonda Hopper
dbf8d19095 [Case 6491] eslint pass: fixes issues with equality checks.
* Also adds some paren grouping to help with readability of some statements.
* eslint pass on script using .eslintrc.js

Changes to be committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-10-02 12:26:00 -04:00
LaShonda Hopper
6571aef997 [Case 6491] makeStretchTool: Fix z undefined issue (details below).
z:z appears to have been a typo, as there's no var z.  Should likely be z:1.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-29 18:52:39 -04:00
LaShonda Hopper
ff051db79a [Case 6491] Minor: Fixes some paren spacing.
Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:06:09 -04:00
LaShonda Hopper
0deabf54ef [Case 6491] Minor: fixes some coding standard spacing with wantDebug statements. 2017-09-28 15:04:28 -04:00
LaShonda Hopper
2bb76a357a [Case 6491] Some adjustments to isActiveTool (details below).
* isActiveTool now respects null and undefined args.
    * If null or undefined toolHandle is passed, activeTool
      is directly tested against those values.  Rather than
      explicitly returning false.
* Added some clarification to unknown tool warning message.

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:28 -04:00
LaShonda Hopper
bed50dda2f [Case 6491] Fixes consistency issue with lights (details below).
Fixes issue with light selection actions having inconsistent ui
in comparison to other selections from an earlier commit change.

As of this commit:
* When translating point lights, the edge grabbers are no longer be visible.
* When rotating or translating spot lights, the edge grabbers are no longer visible.

Note:
* For both point & spot lights, when translating and/or rotating, their circle
  and/or radial guides should remain visible.  This commit shouldn't have any
  influence on that behavior.

Tested:
* Rotating and translating spot lights.
* Translating point lights.  Didn't test rotation as only spot
  lights support rotation.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:28 -04:00
LaShonda Hopper
9fb76340c7 [Case 6491] removes SelectionDisplay.mode (details below).
This var isn't needed as the var essentially piggy backed
off of activeTool and activeTool.mode.

This also helps guard against the _majority_ of situations
where mode check fails due to typo inserted when composing
the check.

Most instances of manual string checks have been replaced by
querying activeTool via new isActiveTool function.  For instances
that still require a direct mode check getMode will return
the mode string associated with the current activeTool.

TODO:  Get this code reviewed.
2017-09-28 15:04:28 -04:00
LaShonda Hopper
3a174780c2 [Case 6491] Minor: Move that.updateHandleSizes up (details below).
It was down below the amidst the mouse event handlers. This just moves
it up with the other that.update handle functions definitions.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:28 -04:00
LaShonda Hopper
9279290b2e [Case 6491] Remove dupe pickRay var (details below).
Ran lint pass and found the dupe define.

As noted in a previous commit, the only remaining lint
issues are as follows:

* scripts/system/libraries/entitySelectionTool.js: line 17, col 1, Read only.
    * HIFI_PUBLIC_BUCKET assignment
* scripts/system/libraries/entitySelectionTool.js: line 19, col 1, Read only.
    * SPACE_WORLD assignment
* scripts/system/libraries/entitySelectionTool.js: line 30, col 1, Read only.
    * SelectionManager assignment

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:28 -04:00
LaShonda Hopper
c286ee95a4 [Case 6491] Zero state improvements (details below).
Fixes issue where when translating the selected object(s),
user view was obstructed by grabber handles.

This also brings more consistency to the selection ui state between
rotation and translation user interactions.  Both types
of interactions feel nicer with the selection ui as concise
as possible during the action, limited only to that useful for
the current interaction.

Expected Behavior:
    Note the following presumes you're in creation mode.
* When the selection is clicked, the rotation, stretch, clone,
  and translateY handles should turn invisible.
* When moving a selection along either the x or z axis, the
  rotation, stretch, clone, and translateY handles should be
  invisible and remain that way until the user releases the selection.
* When the selection is released, the rotation, stretch, clone,
  and translateY handles should become visible.
* When the translateY handle is clicked, the rotation, stretch, and
  clone handles should turn invisible.  The translateY handle should
  remain visible.
* When moving the selection along the y axis, the rotation, stretch,
  and clone handles should be invisible and remain that way until the
  user releases the selection.  The translateY handle should be visible
  during the entire interaction.
* When the selection is released, the rotation, stretch, clone should
  become visible.  The translateY handle, visible the entire time, should
  already be visible.
* When the user click somewhere other than a selection, entity object,
  creation menu or tools, then any current selection should be
  unselected and all creation ui local to it should turn invisible.
* When the user exits creation mode, any current selection should be
  unselected and all creation ui local to it should turn invisible.

TODO:
* We may want to visit the scaling interaction ui as well; however,
  that could be a later task as it's tangential.  The changes here
  are a good first step.
    * The idea with that interaction is perhaps only showing the
      handle for the current scaling operation.  Currently when
      scaling all of the other handles remain visible, though
      their appearance does update.

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:27 -04:00
LaShonda Hopper
45c4a1081b [Case 6491] entityToolSelection logging/print review (details below).
* Added some wantDebug guards to print sections without them.
* Normalized error logging statements to have script name
  and/or specific script function where reasonable.
    * All error statements contain at least the script name
      and a descriptive snippet of the error or clue to resolve it.
* Removed some stale todos.

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:27 -04:00
Leander Hasty
0b86169500 [Case 6491] remove rotateOverlayTarget.
It is no longer used.

Reviewed-by: LaShonda Hopper <lashonda@1stplayable.com>
2017-09-28 15:04:27 -04:00
Leander Hasty
74734f35e9 [Case 6491] more uniform grabber tools; more distrust of rotateOverlayTarget.
Rotation tools' onMove methods now use rayPlaneIntersection rather than using the giant invisible rotateOverlayTarget.  It can likely be entirely removed in the next commit.

tool.onBegin's signature is now (event, pickRay, pickResult, ...) -- this allows us to avoid recomputing the ray or intersection when unnecessary.

translateXZTool is now a part of the grabberTools array; addGrabberTool and addStretchTool have been modified to return the tool reference (and not disassemble and reassemble the tools, so they can keep their own local functions and state).  This does make the array potentially less type-uniform, which may (?) undo some javascript optimizations, but allows us to eventually remove some state -- and they're only 1x/frame methods.

We now compute rotationNormal in rotation tool onBegin, rather than having many different normals lying around.

Merged the final branches in mousePressEvent.

Also fixed issue with mode TRANSLATE_XZ test within updateRotationHandles.

Reviewed-by: LaShonda Hopper <lashonda@1stplayable.com>
2017-09-28 15:04:27 -04:00
Leander Hasty
fa74fbc986 [Case 6491] fixes rotation skip near 0 and 180.
Previously, when rotating, it would be easy to achieve 1 degree granularity, except near the 0 degree and 180 degree "poles", where it would often e.g. jump from 10 to -10, or 174 to -175, or similar.

yawZero/pitchZero/rollZero were all based on the yawHandle/pitchHandle/rollHandle ray intersection, and were not necessarily coplanar with rotateOverlayTarget. As a result, centerToZero didn't lie on the expected plane, while centerToIntersect did.  This had the effect of distorting the rotation range.

We also have a possible issue in here with editOverlay(rotationOverlayTarget,{rotation:...}) not taking effect immediately.  Better to take the existing ray and cast against a known plane, as e.g. translateXZTool and such do.  No risk of stale rotation in that case.

This also cleans up rotationHelper args a bit to avoid some string switches and keep flow a little more readable.

TODO: propagate ray-plane test to helperRotationHandleOnMove rather than relying on ray hit location; normalize onBegin/onMove/etc across all tools to take queryRay and results args to avoid recreating the ray.

Reviewed-by: LaShonda Hopper <lashonda@1stplayable.com>
2017-09-28 15:04:27 -04:00
LaShonda Hopper
fe171af31b [Case 6491] entitySelectionTool mousePressEvent refactor/cleanup (details below).
Fixes situations where attempting to click on a rotate, grab,
or scale handle that was in front of others might unexpectedly
activate the obscured handle.

As of this commit the flow of mousePressEvent such that the
first item whether it be a tool or selection is what reacts
and absorbs the click/touch.  This is counter to the prior
behavior where whichever item or tool last passed the check
would determine what was hit and handled the touch _even_
when it wasn't the first thing to be touched.

* Got rid of some unused/stale vars
* Added some convenience functions
    * setRotationHandlesVisible function
    * setStretchHandlesVisible function
    * setGrabberMoveUpVisible function
* Removed checkIntersectWith helper functions as they're
  no longer used.
* Normalized onBegin signatures for all GrabberTools to
  support the new flow within mousePressEvent.
    * These are tools registered via addGrabberTool/makeStretchTool.
    * The onBegin signature changes from onBegin( event ) to
      onBegin( event, intersectResult ).
        * This allows for a simpler tool triggering where tools which
          utilized the additional information provided will have it,
          those which may need it the future shall have it with little
          issue, and those that don't care may ignore it.

NOTE(s):
* Tested normal movement within opening creation menu:  Passed
* With Creation Menu Open:
    * Tested clicking around the world in empty space: Passed
    * Tested single selection: Passed
    * Tested single selection rotation (pitch, yaw, roll): Passed
    * Tested single selection translation (xz, y): Passed
    * Tested multiple selection: Passed
    * Tested multiple selection rotation (pitch, yaw, roll): Passed
    * Tested multiple selection translation (xz, y): Passed

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:27 -04:00
LaShonda Hopper
96afbeca23 [Case 6491] Dedupe rotation handle tool code (details below).
Pulled the common code shared between the rotation handle
tools out into helper funcs:
* helperRotationHandleOnBegin
* helperRotationHandleOnMove
* helperRotationHandleOnEnd

These functions either take in or derive the necessary info
needed to handle a specific rotation axis.

NOTE(s):
* Tested yaw, pitch, & roll handles using a box. The behavior
  remained consistent with that prior to this commit.

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
2017-09-28 15:04:26 -04:00