aframe-selectable-light-component

0.1.0 • Public • Published

aframe-selectable-component

Selectable Light is a component for A-Frame. It is a fork of scenevr/selectable-component minus the boundingbox. The bounding box in scenevr/selectable-component causes performance issues when you make an a-image selectable.

Usage

Browser Installation

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.2.0/aframe.min.js"></script> 
  <script src="https://rawgit.com/dbradleyfl/aframe-selectable-light-component/master/dist/aframe-selectable-light-component.min.js"></script> 
</head>
 
<body>
  <a-scene>
    <a-assets></a-assets>
    <a-entity selectable>
      <a-entity geometry="primitive: box" material="color: #C03546"></a-entity>
    </a-entity>
 
    <a-sky color="#2ca9df"></a-sky>
 
    <a-entity position="0 1.8 4">
      <a-entity camera="active:true" wasd-controls="" look-controls="" rotation="-24.178818954520754 0.3437746770785027 0" position="0 0 0">
        <a-cursor></a-cursor>
      </a-entity>
    </a-entity>
  </a-scene>
  <script type="text/javascript">
    document.querySelector('a-entity[selectable]').addEventListener('selected', (e) => {
      console.log(e.selected);
    });
  </script> 
</body>

NPM Installation

Install via NPM:

npm install aframe-selectable-light-component

Then register and use.

require('aframe');
require('aframe-selectable-light-component');

Package Sidebar

Install

npm i aframe-selectable-light-component

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • dbradleyfl