mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: hull origins
This commit is contained in:
1 parent
3e12d6bb9d
commit
5295aa37be
14 files changed
+225
-259
No files matched your search
@@ -65,6 +65,7 @@ interface VehicleDefinitions {
|
||||
};
|
||||
chassis: {
|
||||
[key: string]: {
|
||||
hullPosition: string;
|
||||
armor: {
|
||||
leftTrack:
|
||||
| number
|
||||
@@ -294,14 +295,19 @@ export async function buildDefinitions(production: boolean) {
|
||||
const tankDefinition = await readXMLDVPL<{ root: VehicleDefinitions }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/${tankKey}.xml.dvpl`,
|
||||
);
|
||||
const defaultChassis = Object.values(tankDefinition.root.chassis).at(
|
||||
-1,
|
||||
)!;
|
||||
const turretOrigin = tankDefinition.root.hull.turretPositions.turret
|
||||
.split(' ')
|
||||
.map(Number) as Vector3Tuple;
|
||||
const hullOrigin = defaultChassis.hullPosition
|
||||
.split(' ')
|
||||
.map(Number) as Vector3Tuple;
|
||||
const tankId = toUniqueId(nation, tank.id);
|
||||
const tankTags = tank.tags.split(' ');
|
||||
const hullArmor: ModelArmor = { thickness: {} };
|
||||
const trackArmorRaw = Object.values(tankDefinition.root.chassis).at(-1)!
|
||||
.armor.leftTrack;
|
||||
const trackArmorRaw = defaultChassis.armor.leftTrack;
|
||||
const equipment = tankDefinition.root.optDevicePreset;
|
||||
tankStringIdMap[`${nation}:${tankKey}`] = tankId;
|
||||
|
||||
@@ -368,6 +374,7 @@ export async function buildDefinitions(production: boolean) {
|
||||
? trackArmorRaw
|
||||
: trackArmorRaw['#text'],
|
||||
turretOrigin,
|
||||
hullOrigin,
|
||||
turretRotation: tankDefinition.root.hull.turretInitialRotation
|
||||
? {
|
||||
yaw: tankDefinition.root.hull.turretInitialRotation.yaw,
|
||||
|
||||
Reference in new issue
Block a user