Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support GearVR 3DOF controller#2545

Merged
dmarcos merged 4 commits into
aframevr:masterfrom
chenzlabs:gearvr-controls-3dof
Apr 14, 2017
Merged

Support GearVR 3DOF controller#2545
dmarcos merged 4 commits into
aframevr:masterfrom
chenzlabs:gearvr-controls-3dof

Conversation

@machenmusik
Copy link
Copy Markdown
Contributor

This PR, which includes #2538 in its entirety (and is intended to be merged afterward), should add support for the new 3DOF Gear VR Controller as proposed at https://webvr.slack.com/?redir=%2Farchives%2FC0EEECMA5%2Fp1490839724160554

Note that at time of this writing, this PR has not yet been tested on a supporting browser with supported hardware. Once such testing has been completed, this comment will be edited appropriately.

@machenmusik
Copy link
Copy Markdown
Contributor Author

rebased, but will need changes when #2513 is merged

@machenmusik machenmusik force-pushed the gearvr-controls-3dof branch from 7917bd0 to 8da9d87 Compare April 11, 2017 01:48
@machenmusik
Copy link
Copy Markdown
Contributor Author

rebased, onto latest master and also #2567

@dmarcos
Copy link
Copy Markdown
Member

dmarcos commented Apr 11, 2017

This contains #2567
Can we remove it from this one?

@machenmusik
Copy link
Copy Markdown
Contributor Author

i am not sure whether it will work without it. @mkeblx does it work with only the commits after "add gearvr controls", and if so are you able to say that for only Samsung Internet, or also Oculus Browser?

@machenmusik machenmusik force-pushed the gearvr-controls-3dof branch from 60a9783 to b0361ec Compare April 12, 2017 18:00
@machenmusik
Copy link
Copy Markdown
Contributor Author

removed portions from closed #2567 -- @mkeblx does codepen still work?

@machenmusik
Copy link
Copy Markdown
Contributor Author

fixed conflict with @ngokevin hand-controls changes

@machenmusik machenmusik force-pushed the gearvr-controls-3dof branch from 1b9015c to eb39e11 Compare April 12, 2017 18:16
isPresent = isPrefixMatch;
if (isPresent && queryObject.hand) {
isPresent = gamepad.hand === queryObject.hand;
isPresent = (gamepad.hand || DEFAULT_HANDEDNESS) === queryObject.hand;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this instead?

if (isPresent && queryObject.hand && gamepad.hand) { 
isPresent = gamepad.hand === queryObject.hand
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if queryObject.hand === 'left' and no gamepad.hand, DEFAULT_HANDEDNESS should be used so isPresent becomes false, right? with yours, isPresent stays true

// buttonId
// 0 - trackpad
// 1 - triggeri
mapping: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but you haven't merged it yet! from 5 days ago:

rebased, but will need changes when #2513 is merged

onGamepadConnected: function (evt) {
// for now, don't disable controller update listening, due to
// apparent issue with FF Nightly only sending one event and seeing one controller;
// this.everGotGamepadEvent = true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to set this flag?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming that #2513 survives with that flag, that is one of the changes to bring in line with #2513

this.checkIfControllerPresent();
},

onGamepadDisconnected: function (evt) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming that #2513 survives with that flag, that is one of the changes to bring in line with #2513

@machenmusik
Copy link
Copy Markdown
Contributor Author

got confirmation that this PR still works after removing portions of closed #2567.
if #2513 is merged before this one, I will update to conform.
otherwise, should be good to go

@machenmusik machenmusik force-pushed the gearvr-controls-3dof branch from eb39e11 to 62b03eb Compare April 13, 2017 02:06
@mkeblx
Copy link
Copy Markdown
Contributor

mkeblx commented Apr 13, 2017

Added controller model aframevr/assets#20 (Thanks @840labs)

@machenmusik Something like below should work if you want to modify in this PR.

buttonMeshes.trigger = controllerObject3D.getObjectByName('Trigger');
buttonMeshes.trackpad = controllerObject3D.getObjectByName('Touchpad');
// Offset pivot point # can be removed
// controllerObject3D.position.set(0, 0, 0);

Note: Pivot should be not needed, set to center of trackpad like pivot on Daydream controller location.

@machenmusik
Copy link
Copy Markdown
Contributor Author

@mkeblx updated to use your model (I hope). Does http://codepen.io/machenmusik/pen/QvLjbx still work and do you see the new model?

@mkeblx
Copy link
Copy Markdown
Contributor

mkeblx commented Apr 14, 2017

Yep looks good!

com oculus vrshell-20170413-202106

(and the touched: undefined is only after exit out of Presenting; only accessible when presenting)

@machenmusik
Copy link
Copy Markdown
Contributor Author

@mkeblx niiice! one more to try -- we're trying to land #2513, this codepen brings this PR into line with that one, does it work as well? http://codepen.io/machenmusik/pen/Gmgmgw

@mkeblx
Copy link
Copy Markdown
Contributor

mkeblx commented Apr 14, 2017

Yes that works.

@dmarcos
Copy link
Copy Markdown
Member

dmarcos commented Apr 14, 2017

Thanks everybody! Controller collection complete. Cross platform achievement unlocked!

@dmarcos dmarcos merged commit e73e3aa into aframevr:master Apr 14, 2017
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.

4 participants