Skip to content

Instantly share code, notes, and snippets.

View nosslin579's full-sized avatar

Christian Nilsson nosslin579

View GitHub Profile
@chrahunt
chrahunt / tagpro-box2d-prediction.js
Created June 29, 2015 14:55
Predict future state in TagPro.
var dt = (1.0 / 60);
var damping = 0.5;
// Scale between Box2d physics and tagpro physics.
var scale = 100;
// Damping factor.
var d = 1 - damping * dt;
/**
* Get predicted velocity along one axis.
* @param {number} v0 - Initial velocity
* @param {number} a - Acceleration