rl-loadout-lib
Version:
Load Rocket League assets into three.js
21 lines • 659 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const wheels_model_1 = require("./wheels-model");
const ANIM_INTERVAL = 1000;
/**
* Animated model for the Spinner wheels.
*/
class SpinnerModel extends wheels_model_1.WheelsModel {
animate(t, wheel, roll) {
const dt = t % ANIM_INTERVAL;
const angle = 2 * Math.PI * (dt / ANIM_INTERVAL);
if (wheel.config.right) {
wheel.spinnerJoint.rotation.y = roll - angle;
}
else {
wheel.spinnerJoint.rotation.y = -roll + angle;
}
}
}
exports.SpinnerModel = SpinnerModel;
//# sourceMappingURL=spinner-model.js.map