rl-loadout-lib
Version:
Load Rocket League assets into three.js
69 lines • 1.99 kB
JavaScript
;
/* tslint:disable:variable-name */
Object.defineProperty(exports, "__esModule", { value: true });
const item_1 = require("./item");
const three_1 = require("three");
const constants_1 = require("../3d/constants");
const quality_1 = require("./quality");
/**
* Rocket League car wheels.
*/
class Wheel extends item_1.Item {
}
exports.Wheel = Wheel;
/**
* The default OEM wheels.
*/
Wheel.DEFAULT = {
icon: 'wheel/WHEEL_Star/WHEEL_Star_TThumbnail.jpg',
id: 376,
model: 'wheel/WHEEL_Star/WHEEL_Star_SM.glb',
name: 'OEM',
paintable: true,
quality: quality_1.Quality.COMMON,
rim_base: 'wheel/WHEEL_Star/OEM_D.tga',
rim_rgb_map: 'wheel/WHEEL_Star/OEM_RGB.tga',
rim_n: 'wheel/WHEEL_Star/OEM_N.tga',
tire_base: 'wheel/WHEEL_Star/Tire_Swarm_Tyr_Diffuse.tga',
tire_n: 'wheel/WHEEL_Star/Tire_Swarm_Tyr_Normal.tga'
};
/**
* Properties for a single wheel (out of 4 usually) on a body.
*/
class WheelConfig {
constructor() {
/**
* Position of the wheel, relative to the joint.
*/
this.position = new three_1.Vector3();
/**
* Width of the wheel.
*/
this.width = constants_1.BASE_WHEEL_MESH_WIDTH;
/**
* Radius of the wheel.
*/
this.radius = constants_1.BASE_WHEEL_MESH_RADIUS;
/**
* Side offset of the wheel. Positive values move the wheel "outwards".
*/
this.offset = 0;
}
/**
* Create a new config identical to this.
*/
clone() {
const newObj = new WheelConfig();
newObj.right = this.right;
newObj.front = this.front;
newObj.width = this.width;
newObj.radius = this.radius;
newObj.offset = this.offset;
newObj.position = new three_1.Vector3();
newObj.position.copy(this.position);
newObj.joint = this.joint;
return newObj;
}
}
exports.WheelConfig = WheelConfig;
//# sourceMappingURL=wheel.js.map