rl-loadout-lib
Version:
Load Rocket League assets into three.js
39 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const object_1 = require("../object");
const rye_tier1_model_1 = require("./rye-tier1-model");
const util_1 = require("../../utils/util");
/**
* Class for the 3D model of Maverick GXT. Needed because of custom textures.
*/
class RyeTier2Model extends rye_tier1_model_1.RyeTier1Model {
constructor(body, decal, bodyAssets, decalAssets, paints) {
super(body, decal, bodyAssets, decalAssets, paints);
this.init();
}
init() {
super.init();
const bodyAssets = this.bodyAssets;
this.kitMaterial.map = util_1.htmlImageToTexture(bodyAssets.kitD);
this.kitMaterial.normalMap = util_1.htmlImageToTexture(bodyAssets.kitN);
}
handleModel(scene) {
super.handleModel(scene);
object_1.traverseMaterials(scene, mat => {
if (mat.name === 'MIC_Parts_Tier02') {
this.kitMaterial = mat;
}
});
}
copy(other) {
super.copy(other);
this.init();
}
clone() {
const m = new RyeTier2Model();
m.copy(this);
return m;
}
}
exports.RyeTier2Model = RyeTier2Model;
//# sourceMappingURL=rye-tier2-model.js.map