aframe-proxemic-component
A Proxemic Interactions component for A-Frame.
Last updated 2 months ago by jorgecardoso .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install aframe-proxemic-component 
SYNC missed versions from official npm registry.

A-Frame Proxemics Interactions component

Version License

A Proxemic Interactions component for A-Frame.

For A-Frame.

proximity-sensor

Property Description Default Value
distance Distance, in meters, to the target object which will trigger the sensor. 1
target Selector to identify the target object. By default the proximity sensor will trigger in response to the camera object. [camera]

Events

Event Description
proximityenter Triggered when the distance between this entity and the target entity transitions between being above to being below the distance property value.
proximityexit Triggered 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');

=======

Current Tags

  • 0.0.16                                ...           latest (2 months ago)

16 Versions

  • 0.0.16                                ...           2 months ago
  • 0.0.15                                ...           2 months ago
  • 0.0.14                                ...           4 months ago
  • 0.0.13                                ...           4 months ago
  • 0.0.12                                ...           4 months ago
  • 0.0.11                                ...           4 months ago
  • 0.0.10                                ...           4 months ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (52)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |