Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Box2D by Erin Catto with google's particle simulation liquidfun for node.js.
Fork from box2d.js.
Due to the fact that we are not creating sub-classes of C++ classes, we do not need to use 'b2' prefix to separate namespaces so this prefix has been removed.
// Instead of writing box2d.b2Vec2
// Write this:
const b2 = require ( 'lucy-b2' )
let gravity = new b2.Vec2 ( 0, -9.8 )
let world = new b2.World ( gravity )
// ...
let shape = new b2.PolygonShape
Here is a falling ball simulation.
'use strict'
const b2 = require ( 'lucy-b2' )
// Create world
let gravity = new b2.Vec2 ( 0, -9.8 )
let world = new b2.World ( gravity )
// Define body
let bodyDef = new b2.BodyDef
bodyDef.type = b2.BodyType.dynamicBody
// Create body with definition
let body = world.CreateBody ( bodyDef )
// Define fixture
let fixDef = new b2.FixtureDef
fixDef.density = 1.0
fixDef.friction = 0.2
fixDef.restitution = 0.8
let shape = new b2.PolygonShape
shape.SetAsBox ( 0.1, 0.1 )
fixDef.shape = shape
// Create fixture
body.CreateFixture ( fixDef )
// Move body into initial position ( and rotation )
body.SetTransform ( 0, 2, 0 )
// Run simulation
for ( let i = 0; i < 10; i++ )
{ world.Step ( 1/60, 10, 10 )
console.log ( body.GetPosition ().y )
}
npm install lucy-b2 --save
npm test
Please see box2d.js for contributions. The port from this library is just a few Regexp executed on the minified JS version and a wrapper for node.js.
Please use 'jessy style' if you want to write some unit tests for lucy-b2...
FAQs
2D physics (Box2D with liquidfun particles).
The npm package lucy-b2 receives a total of 5 weekly downloads. As such, lucy-b2 popularity was classified as not popular.
We found that lucy-b2 demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.