juniorrojas/algovivo

An energy-based formulation for soft-bodied virtual creatures

What it solves

It provides a way to simulate soft-bodied virtual creatures without needing to manually derive complex force functions or write explicit position update rules. Instead, it uses an energy-based formulation to handle physics simulations of deformable bodies.

How it works

The system implements physics via gradient-based optimization of differentiable energy functions. It uses automatic differentiation (via Enzyme) to compute forces and derivatives. The simulation includes six specific energy functions: neo-Hookean triangles, controllable muscles, gravity, terrain collision, friction, and inertia. The core logic is written in C++, compiled to WebAssembly (WASM), and wrapped in a JavaScript library for browser-based execution.

Who it’s for

It is designed for researchers and developers interested in soft-body physics, virtual creature simulation, and the intersection of robotics and differentiable physics.

Highlights

  • Differentiable Physics: Uses automatic differentiation to compute forces from energy functions.
  • Neural Control: Supports mapping proprioceptive signals to muscle commands using a pretrained MLP (Multi-Layer Perceptron) controller for locomotion.
  • Web-Ready: Compiled to WebAssembly for high-performance simulation directly in the browser.
  • Energy-Based Formulation: Implements a variety of physical constraints including friction, gravity, and terrain collision.

Related

  • Project
  • Project
  • Project
  • Project
  • Project