Skip to content

activatable reaction component#148

Open
InfiniteLee wants to merge 9 commits into
c-frame:masterfrom
MozillaReality:feature/activatable
Open

activatable reaction component#148
InfiniteLee wants to merge 9 commits into
c-frame:masterfrom
MozillaReality:feature/activatable

Conversation

@InfiniteLee

@InfiniteLee InfiniteLee commented Jul 19, 2018

Copy link
Copy Markdown
Contributor

I have run npm run test:machinima, and this patch passes all machinima tests: no

This is very WIP right now

provides bindings for secondary activations while an object is being grabbed. configurable to allow specifying a specific button event, to allow you to have multiple activatable components on an object (this may not be the best way to do this)

provides bindings for secondary activations while an object is being grabbed. configurable to allow specifying a specific button event, to allow you to have multiple activatable components on an object (this may not be the best way to do this)
@InfiniteLee InfiniteLee mentioned this pull request Jul 19, 2018

@wmurphyrd wmurphyrd left a comment

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.

Thanks for getting this going! Looking forward to building it out together and getting it setup with a testing suite.

Comment thread index.js Outdated
deactivated = this.state.get(this.DEACTIVATE_EVENT)
}
if (deactivated) {
this.state.set(this.DEACTIVATE_EVENT, deactivated)

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.

Do you have a need for storing the last activated entity on the state? So far, the gestures only track the current interaction.

Comment thread index.js Outdated
activated = this.state.get(this.ACTIVATE_EVENT)
}
if (activated) {
this.state.set(this.ACTIVATE_EVENT, activated)

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.

I think this is unreachable - I don't see another place where the activated state is set, so the condition would always be false

@InfiniteLee InfiniteLee Jul 23, 2018

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.

Grabbing an object with two hands? nevermind

Comment thread index.js Outdated
const carried = this.state.get(this.GRAB_EVENT)
let activated = this.state.get(this.ACTIVATE_EVENT)
if (carried) {
if (!activated && !this.emitCancelable(carried, this.ACTIVATE_EVENT, {hand: this.el, buttonEvent: 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.

This would mean only an entity which is already the grabbed entity can be activated. In this respect, it wouldn't be much different from the drag gesture. What would you say to making this a more general gesture, just the act of pressing a button while targeting an entity? I'm thinking this way the activatable component would replace the clickable component and do a better job of what it has been trying to do without interfering with grabbing. When you do want an activation that is dependent on also being grabbed, that logic could be handled within the reaction component instead.

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.

This was definitely intended to be similar to draggable, but more generic and customizable (since you can specify exactly what state to set on the objects so you can have multiple). Also, given clickable exists, I didn't see the need to allow activatable to work on ungrabbed objects. I am not opposed to rolling all three of these together since they are pretty similar.

@InfiniteLee

Copy link
Copy Markdown
Contributor Author

It occurs to me the latest version I've pushed of this is still not quite what I would like, as I would like to customize state set on the super-hands as well (not just the state set on the objects). The problem is I don't know the best way to have that value defined on the reaction component, but read by the super-hand.

@InfiniteLee InfiniteLee mentioned this pull request Aug 23, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants