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

aabb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aabb

Axis-align bounding box

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AABB

Axis-Aligned Bounding Boxes

Introduction

Installation

npm install aabb

Usage

Examples

TODO

APIs

AABB

constructor (min = [0,0,0], max = [0,0,0])

min the minimum coordinates of the AABB. In a 2-D AABB in screen space, the coordinates for the upper-left corner.

max the maximum coordinates of the AABB. In a 2-D AABB in screen space, the coordinates for the lower-right corner.

Constructs a new AABB of dimensionality equal to min.length using the specified bounds.

NOTE The number of elements in min and max (ie. the dimensions) must be the same.

getLength (axis)

axis the zero-based array index representing a particular axis. By convention, 0 = x, 1 = y, 2 = z, and so on.

Returns the length of the AABB along the side defined by axis.

getLengths ()

Returns an array containing the lengths of all sides of the AABB.

expandByAABB (otherAABB)

Expand this to contain otherAABB.

expandToContainElements (elements, startAt = 0)

elements an array of elements.

startAt offset into the elments which to start at.

Expand this to contain all elements.

makeToContainElements (elements)

elements an array of elements.

Return a new AABB that contains the bounds of all elements.

overlaps (otherAABB)

Returns true if this and otherAABB overlap each other.

contains (otherAABB)

Returns true if this completely contains otherAABB.

contained (otherAABB)

Returns true if this is completely contained by otherAABB.

getSurfaceArea ()

Returns the surface area of the AABB. In the 2 dimension case, this is the AABB's perimeter.

getVolume ()

Returns the volume of the AABB. In the 2 dimension case, this is the AABB's area.

clone ()

Returns a clone of this.

intersectWithRay (ray)

ray a ray to test against.

Returns false is no intersection is possible. Otherwise, returns the portion of the ray (a ray segment) that results from the intersection of the ray with the AABB.

intersectWithSegment (rs)

rs - a ray segment to test against.

Returns false is no intersection is possible. Otherwise, returns the portion of the ray segment that results from the intersection of the ray segment with the AABB.

Keywords

FAQs

Package last updated on 27 Oct 2012

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