
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
detect collisions 2d between all possible kinds of shapes. It uses Bounding Volume Hierarchy (BVH) for sweep wide quick tree trim phase, and the Separating Axis Theorem (SAT) for accurate detection inside nearby groups. This library supports RayCasting, o
check2d is a feature-complete 2D collision detection library for JavaScript, designed for real-time games and simulations.
It combines a Bounding Volume Hierarchy (BVH) broad phase with Separating Axis Theorem (SAT) narrow phase detection, providing fast and accurate collision checks across many shape types.
const { System } = require('check2d')
const system = new System()
const { Box, Circle, Polygon } = require('check2d')
const box = system.createBox({ x: 0, y: 0 }, 10, 10)
const circle = new Circle({ x: 5, y: 0 }, 5)
system.insert(circle)
Bodies can be transformed freely. Changes are batched and applied once.
box.setPosition(10, 5, false)
box.setAngle(Math.PI / 4, false)
box.setScale(2, 1, false)
box.move(1, false)
box.updateBody()
Supported features include:
system.checkAll((result) => {
console.log(result)
})
system.checkOne(box, (result) => {
console.log(result)
})
// optional automatic separation
system.separate()
const points = system.getCollisionPoints(result.a, result.b)
const hit = system.raycast(
{ x: 0, y: 0 },
{ x: 0, y: -10 },
(body) => true
)
if (hit) {
const { point, body } = hit
console.log(point, body)
}
Draw bodies directly to a <canvas> context:
context.beginPath()
system.draw(context)
context.stroke()
Draw BVH bounding boxes:
context.beginPath()
system.drawBVH(context)
context.stroke()
import { System } from 'https://esm.sh/check2d'
Test Suites: 12 passed, 12 total
Tests: 84 passed, 84 total
Run benchmarks and stress tests:
git clone https://github.com/nenjack/check2d.git
cd check2d
npm i
npm run benchmark
yarn add check2d
API reference and guides: https://nenjack.github.io/check2d/
Physics engines like Matter.js or Planck.js are excellent when full simulation is required, but they often introduce unnecessary overhead when only collision detection is needed.
check2d focuses purely on collision detection:
This makes it ideal as a standalone collision system or as the foundation of a custom physics engine.
Contributions are welcome.
npm run precommitanyMIT
FAQs
detect collisions 2d between all possible kinds of shapes. It uses Bounding Volume Hierarchy (BVH) for sweep wide quick tree trim phase, and the Separating Axis Theorem (SAT) for accurate detection inside nearby groups. This library supports RayCasting, o
The npm package check2d receives a total of 3,398 weekly downloads. As such, check2d popularity was classified as popular.
We found that check2d demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain