npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eulerjs/vehicle

v0.2.2

Published

Ray-cast vehicles for eulerjs: wheels on springs, tyres with grip

Readme

@eulerjs/vehicle

Ray-cast vehicles for eulerjs: a chassis body carried by wheels, each a ray down from its suspension mount to whatever ground is under it, flat or not, still or moving, with a spring and damper between them and a tyre that grips up to a limit.

npm install @eulerjs/vehicle @eulerjs/core three
import { RaycastVehicle } from '@eulerjs/vehicle';

const vehicle = chassis.addBehavior(
  new RaycastVehicle({
    wheels: mounts.map((mount) => ({ mount, radius: 0.32, suspensionLength: 0.35, springStiffness: 30_000, springDamping: 2400, grip: 1 })),
  }),
);
// every step, or whenever the driver does something
vehicle.wheels[0].steerAngle = vehicle.wheels[1].steerAngle = 0.3;
for (const wheel of vehicle.wheels) wheel.driveForce = 1500;

Each wheel takes a steerAngle, a driveForce and a brakeForce (which stops the wheel, never drives it backward), and its grip can be changed, as a handbrake does to the rear tyres. The tyre's forces grow with how much it slips, up to its grip times the load on it; beyond that it slides, which is how a car drifts, skids and spins out. Braked on a slope, it stands still. The wheels push back on what they stand on, so a car on a crate presses it into the ground. After each step every wheel reports whether it is on the ground, its compression, load, contact point and normal, what it stands on, and its centre and spin, for drawing it. A wheel stands only on ground that faces up along its strut, never a wall or a tree's trunk, nor anything its ray starts inside (as it will with the chassis pressed against something); at the end of its travel a bump stop holds the chassis up.

For a racing car, tyres: 'slip' gives each wheel a spin of its own, driven and braked by driveTorque and brakeTorque, and a tyre that pulls with how much it slips along and across, on a tyre curve: it peaks, grips less past its peak, and less a newton under more load, so a wheel spins up, locks and slides as a real one does. A surface callback says what the ground is like where each wheel touches it, its grip, its drag and its height, so that kerbs, grass and gravel can all be one flat collider.

The engine, gears, steering feel and air drag are yours: the city example builds a hatchback on it, and the formula car example a Formula 1 car on slip tyres. Needs three 0.166 or later. See the guide.

MIT licensed.