0.0.21 • Published 2 years ago

aframe-proxemic-component v0.0.21

Weekly downloads
16
License
MIT
Repository
github
Last release
2 years ago

A-Frame Proxemics Interactions component

Version License

A Proxemic Interactions component for A-Frame.

For A-Frame.

proximity-sensor

PropertyDescriptionDefault Value
distanceDistance, in meters, to the target object which will trigger the sensor.1
targetSelector to identify the target object. By default the proximity sensor will trigger in response to the camera object.camera
hiddenWhether to trigger events on hidden entitiesfalse

Events

EventDescription
proximityenterTriggered when the distance between this entity and the target entity transitions between being above to being below the distance property value.
proximityexitTriggered when the distance between this entity and the target entity transitions between being below to being above the distance property value.

Example

<a-scene environment="preset: forest">
    <a-sphere proximity-sensor="target:#two; distance: 1"
           radius="0.25" id="one" side="both" color="green" position="-2 1.6 -4"
           animation="property:position; from: -2 1.6 -4; to: 2 1.6 -4; dur: 5000; dir: alternate; loop: true"
           event-set__proximityenter="material.color: red"
           event-set__proximityexit="material.color: green"
    ></a-sphere>

    <a-box proximity-sensor="target:#one; distance: 2"
           width="0.5" height="0.5" depth="0.5" id="two" side="both" color="green" position="2 1.6 -4"
           animation="property:position; from: 2 1.6 -4; to: -2 1.6 -4; dur: 5000; dir: alternate; loop: true"
           event-set__proximityenter="material.color:blue"
           event-set__proximityexit="material.color: green"
    ></a-box>
</a-scene>

Additional examples:

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-proxemic-component/dist/aframe-proxemic-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity proximity-sensor></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-proxemic-component

Then require and use.

require('aframe');
require('aframe-proxemic-component');

=======

0.0.20

2 years ago

0.0.21

2 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.10

4 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago