mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: gun & turret origins
This commit is contained in:
1 parent
b433129354
commit
28dde23115
3 files changed
+54
-41
No files matched your search
@@ -35,7 +35,10 @@ const vertexAttributeGltfVectorSizes = {
|
||||
[VertexAttribute.TANGENT]: 4,
|
||||
} as const;
|
||||
|
||||
const omitNames = ['chassis_chassis_', 'chassis_track_crash_', 'HP_'];
|
||||
const omitMeshNames = {
|
||||
start: ['chassis_chassis_', 'chassis_track_crash_', 'HP_'],
|
||||
end: ['_POINT'],
|
||||
};
|
||||
|
||||
export async function extractModel(
|
||||
data: string,
|
||||
@@ -145,7 +148,11 @@ export async function extractModel(
|
||||
|
||||
function parseHierarchies(hierarchies: Hierarchy[], parent: Scene | Node) {
|
||||
hierarchies.forEach((hierarchy) => {
|
||||
if (omitNames.some((omit) => hierarchy.name.startsWith(omit))) return;
|
||||
if (
|
||||
omitMeshNames.start.some((omit) => hierarchy.name.startsWith(omit)) ||
|
||||
omitMeshNames.end.some((omit) => hierarchy.name.endsWith(omit))
|
||||
)
|
||||
return;
|
||||
|
||||
const node = document.createNode(hierarchy.name);
|
||||
const components = times(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { deburr } from 'lodash';
|
||||
import { Vector3Tuple } from 'three';
|
||||
import { TankType, TreeTypeString } from '../../components/Tanks';
|
||||
import { asset } from './asset';
|
||||
|
||||
@@ -9,6 +10,7 @@ export interface TankDefinition {
|
||||
id: number;
|
||||
nation: string;
|
||||
name: string;
|
||||
turretOrigin: Vector3Tuple;
|
||||
tree_type: TreeTypeString;
|
||||
tier: Tier;
|
||||
type: TankType;
|
||||
@@ -25,6 +27,7 @@ export interface TurretDefinition {
|
||||
name: string;
|
||||
tier: Tier;
|
||||
yaw?: [number, number];
|
||||
gunOrigin: Vector3Tuple;
|
||||
guns: GunDefinition[];
|
||||
}
|
||||
export type GunDefinition = GunDefinitionBase &
|
||||
|
||||
Reference in new issue
Block a user