explaingit

icurtis1/raycast-vehicle

Analysis updated 2026-05-18

28JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A browser-playable RC car demo showing off raycast-based vehicle physics built with three.js and cannon-es.

Mindmap

mindmap
  root((raycast-vehicle))
    What it does
      RC car demo
      Raycast wheel physics
      Live tuning panel
    Tech stack
      three.js
      cannon-es
      Node.js
    Use cases
      Study vehicle physics
      Play in browser
      Tune car feel
    Audience
      Game developers
      Three.js learners
      Physics hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Study a working example of raycast vehicle physics for a browser game.

USE CASE 2

Play the live demo in a browser using keyboard, touch, or a gamepad.

USE CASE 3

Tune vehicle feel, like suspension stiffness and jump height, using the live tuning panel.

USE CASE 4

Learn how to convert a 3D level model into exact physics colliders instead of hand-built collision boxes.

What is it built with?

JavaScriptthree.jscannon-esNode.jslil-gui

How does it compare?

icurtis1/raycast-vehicledb9cd2fgbj-hash/codex-deepseek-bridgedeanwhitex/aiw2.0stack
Stars282828
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

Raycast RC Car is an arcade-style browser game demo built with three.js for graphics and cannon-es for physics. It shows off a raycast vehicle technique: each wheel is simulated as a downward-pointing ray acting like a spring and damper, rather than a separate physical wheel object, which the README says is what makes the approach fast and stable. The physics ideas are credited to Bruno Simon's portfolio site and the open-source Sketchbook project. The car itself is a single box-shaped rigid body with four small spheres tucked into its corners, needed because the physics engine's mesh colliders only generate contact against spheres and flat planes, not boxes. The driving level is a single 3D model file used for both what you see and what you collide with, since every mesh in it becomes an exact collision shape, so ramps, loops, and curved walls work without anyone hand building separate collision boxes. A chase camera smoothly follows the car, widening its field of view and pulling back during a boost, and a post-processing pass adds color grading, vignette, chromatic aberration, film grain, and a wind-streak effect while boosting. You can drive with a keyboard using WASD or arrow keys, an on-screen joystick on touch devices, or a browser Gamepad API controller, with shift or a trigger for boost and space or a face button to jump or handbrake. A live tuning panel, hidden on touch devices, exposes vehicle, camera, world, effects, and model settings so you can adjust engine force, steering sharpness, tire grip, suspension stiffness, and jump feel while the demo runs, with a button to reset everything to the shipped defaults. Running it locally requires Node.js 20 or newer, followed by npm install and npm run dev, and the README also documents a few specific cannon-es quirks the author ran into, like stale collision bounds after moving a static body.

Copy-paste prompts

Prompt 1
Explain how the raycast vehicle wheel simulation in this repo works instead of using separate wheel colliders.
Prompt 2
Walk me through running this three.js and cannon-es RC car demo locally with npm.
Prompt 3
Show me how the chase camera in src/main.js follows and widens its view during a boost.
Prompt 4
Help me tune the suspension and steering parameters in src/Vehicle.js to change how the car feels.

Frequently asked questions

What is raycast-vehicle?

A browser-playable RC car demo showing off raycast-based vehicle physics built with three.js and cannon-es.

What language is raycast-vehicle written in?

Mainly JavaScript. The stack also includes JavaScript, three.js, cannon-es.

How hard is raycast-vehicle to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is raycast-vehicle for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.