Newer
Older
Brian Peiris
committed
/**
Brian Peiris
committed
* @namespace interactables
* @component hover-visuals
*/
AFRAME.registerComponent("hover-visuals", {
schema: {
hand: { type: "string" },
controller: { type: "selector" }
},
Brian Peiris
committed
// uniforms are set from the component responsible for loading the mesh.
this.uniforms = null;
},
remove() {
Brian Peiris
committed
},
if (!this.uniforms || !this.uniforms.size) return;
Brian Peiris
committed
this.el.object3D.matrixWorld.toArray(interactorTransform);
const hovering = this.data.controller.components["super-hands"].state.has("hover-start");
Brian Peiris
committed
if (this.data.hand === "left") {
uniform.hubs_HighlightInteractorOne.value = hovering;
uniform.hubs_InteractorOnePos.value[0] = interactorTransform[12];
uniform.hubs_InteractorOnePos.value[1] = interactorTransform[13];
uniform.hubs_InteractorOnePos.value[2] = interactorTransform[14];
} else {
uniform.hubs_HighlightInteractorTwo.value = hovering;
uniform.hubs_InteractorTwoPos.value[0] = interactorTransform[12];
uniform.hubs_InteractorTwoPos.value[1] = interactorTransform[13];
uniform.hubs_InteractorTwoPos.value[2] = interactorTransform[14];