Skip to content

VirtualMouseModule: support for groups #273

@sasha240100

Description

@sasha240100

The current version of VirtualMouseModule doesn't support groups and children.

Temporary workaround:

mouseModule.intersection = function(component) {
	const rc = this.raycaster;

	let singleObject = true;
	let object = component.native;
	let objects = [];

	if (object.children.length > 0) {
		singleObject = false;

		object.traverse(child => {
			objects.push(child);
		})
	}

  return singleObject ? rc.intersectObject(object) : rc.intersectObjects(objects);
}

mouseModule.hovers = function(component) {
	return this.intersection(component).length > 0;
}

TODO:

  • Support for nested objects
    • .intersection() for children
Version:
  • v2.x.x
  • v1.x.x
Issue type:
  • Bug
  • Proposal/Enhancement
  • Question
  • Discussion

Tested on:
Desktop
  • Chrome
  • Chrome Canary
  • Chrome dev-channel
  • Firefox
  • Opera
  • Microsoft IE
  • Microsoft Edge
Android
  • Chrome
  • Firefox
  • Opera
IOS
  • Chrome
  • Firefox
  • Opera

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions