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

box-frustum

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

box-frustum

Checks if an axis aligned bounding box intersects a camera frustum.

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

box-frustum

A function to test if an axis aligned bounding box interesects the camera frustum.

Usage/Installation

First, pull this in via npm:

npm install box-frustum

Then you can do a frustum test like this:

require("box-frustum")(
  [1, 0, 0, 0,
   0, 1, 0, 0,
   0, 0, 1, 0,
   0, 0, 0, 1],
  [[-1,-1,-1], [1,1,1]])
  

Which will check if axis-aligned bounding box from (-1,-1,-1) to (1,1,1) intersects the frustum for the unit matrix.

require("box-frustum")(m, box)

module.exports implements the frustum test. It takes two arguments:

  • m is an array of 16 float values representing the homogeneous clip coordinate matrix for the camera in row major order.
  • box = [lo, hi] is an array of two length 3 arrays giving the bounds for the axis aligned bounding.

Results: true if the box intersects the camera frustum, flase otherwise.

Credits

(c) 2013 Mikola Lysenko. BSD

Keywords

FAQs

Package last updated on 09 Feb 2013

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