Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aframe-aabb-collider-component

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-aabb-collider-component

An axis-aligned bounding box component for A-Frame.

  • 3.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

aframe-aabb-collider-component

Version License

An axis-aligned bounding box component for A-Frame. Provides collision detection.

For A-Frame.

API

PropertyDescriptionDefault Value
collideNonVisibleWhether to check for collisions against non-visible entities.false
debugWhether to draw bounding box helpers.false
enabledWhether collision checks are running.true
objectsSelector of entities to intersection test against.''
intervalMilliseconds in between intersection checks.80

If the target collidable object is moving, set <a-entity data-aabb-collider-dynamic> on the target. By default, collidable objects are presumed to be static for performance purposes.

Events
EventDescription
hitstartIntersection between box and another entity. Emitted on both source and target if target does not have AABB.
hitendNo longer intersecting between box and another entity. Emitted on both source and target if target does not have AABB.
hitclosestIntersection between the box and the closest entity from its center. Only one entity is "closest" at a time.
hitclosestclearThe previously closest intersected entity to the box is no longer the closest entity.
Members

Accessed via entity.components['aabb-collider'][<member>].

NameDescription
closestIntersectedElClosest collided entity.
intersectedElsArray of current collided entities.

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.9.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-aabb-collider-component@3.1.0/dist/aframe-aabb-collider-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity hand-controls="right" aabb-collider="objects: .box"></a-entity>
    <a-box class="box" color="blue" position="0 1 -5"></a-box>
  </a-scene>
</body>
npm

Install via npm:

npm install aframe-aabb-collider-component

Then require and use.

require('aframe');
require('aframe-aabb-collider-component');

Keywords

FAQs

Package last updated on 05 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc