mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
fix: negative hard joint handling... correctly this time
This commit is contained in:
1 parent
062e6e9626
commit
0582339332
4 files changed
+30
-20
No files matched your search
@@ -58,10 +58,7 @@ export async function extractArmor(data: string, fileName: string) {
|
||||
|
||||
attributes.get(attribute)!.push(value);
|
||||
|
||||
if (
|
||||
attribute === VertexAttribute.HARD_JOINTINDEX &&
|
||||
value[0] !== -1
|
||||
) {
|
||||
if (attribute === VertexAttribute.HARD_JOINTINDEX) {
|
||||
hardJointIndices.add(value[0]);
|
||||
vertexHardJointIndices.set(index, value[0]);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function nameToArmorId(name: string) {
|
||||
const match = name.match(/.+_armor_(\d+)/);
|
||||
const match = name.match(/.+_armor_(-?\d+)/);
|
||||
const group1 = match![1];
|
||||
|
||||
return parseInt(group1);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { ModelArmor } from './modelDefinitions';
|
||||
|
||||
export function resolveArmor(armor: ModelArmor, index: number) {
|
||||
const spaced = armor.spaced?.includes(index) ?? false;
|
||||
const thickness = index === -1 ? 0 : armor.thickness[index] ?? 0;
|
||||
|
||||
return { spaced, thickness };
|
||||
}
|
||||
Reference in new issue
Block a user