mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: support transparency
This commit is contained in:
1 parent
06a3791ddd
commit
4ab03e56a2
7 files changed
+190
-184
No files matched your search
+101
-102
@@ -1,20 +1,19 @@
|
||||
import { Vector3Tuple, Vector4Tuple } from 'three';
|
||||
import { ScpgReadStream } from './scpg';
|
||||
import { Vector3Tuple, Vector4Tuple } from "three";
|
||||
import { ScpgReadStream } from "./scpg";
|
||||
|
||||
export interface SC2 {
|
||||
'#dataNodes': DataNode[];
|
||||
'#hierarchy': Hierarchy[];
|
||||
'#sceneComponents': SceneComponents;
|
||||
"#dataNodes": DataNode[];
|
||||
"#hierarchy": Hierarchy[];
|
||||
"#sceneComponents": SceneComponents;
|
||||
}
|
||||
|
||||
type DataNode = {
|
||||
'##name': 'NMaterial';
|
||||
'#id': ArrayBuffer;
|
||||
"##name": "NMaterial";
|
||||
"#id": ArrayBuffer;
|
||||
materialName: string;
|
||||
parentMaterialKey?: bigint;
|
||||
qualityGroup?: string;
|
||||
fxName?: string;
|
||||
|
||||
textures?: Textures;
|
||||
} & (
|
||||
| ({
|
||||
@@ -80,8 +79,8 @@ export interface Textures {
|
||||
}
|
||||
|
||||
export interface Hierarchy {
|
||||
'##name': 'Entity';
|
||||
'#hierarchy'?: Hierarchy[];
|
||||
"##name": "Entity";
|
||||
"#hierarchy"?: Hierarchy[];
|
||||
components: Components;
|
||||
flags: number;
|
||||
id: bigint;
|
||||
@@ -97,12 +96,12 @@ type Components = {
|
||||
type RoBatches = Record<
|
||||
string,
|
||||
{
|
||||
'##name': 'RenderBatch';
|
||||
'rb.aabbox': RbAabbox;
|
||||
'rb.classname': 'RenderBatch';
|
||||
'rb.datasource': bigint;
|
||||
'rb.nmatname': bigint;
|
||||
'rb.sortingKey': number;
|
||||
"##name": "RenderBatch";
|
||||
"rb.aabbox": RbAabbox;
|
||||
"rb.classname": "RenderBatch";
|
||||
"rb.datasource": bigint;
|
||||
"rb.nmatname": bigint;
|
||||
"rb.sortingKey": number;
|
||||
}
|
||||
>;
|
||||
|
||||
@@ -113,50 +112,50 @@ interface RbAabbox {
|
||||
|
||||
export type Component =
|
||||
| {
|
||||
'comp.typename': 'TransformComponent';
|
||||
'tc.localRotation': Vector4Tuple;
|
||||
'tc.localScale': Vector3Tuple;
|
||||
'tc.localTranslation': Vector3Tuple;
|
||||
'tc.worldRotation': Vector4Tuple;
|
||||
'tc.worldScale': Vector3Tuple;
|
||||
'tc.worldTranslation': Vector3Tuple;
|
||||
"comp.typename": "TransformComponent";
|
||||
"tc.localRotation": Vector4Tuple;
|
||||
"tc.localScale": Vector3Tuple;
|
||||
"tc.localTranslation": Vector3Tuple;
|
||||
"tc.worldRotation": Vector4Tuple;
|
||||
"tc.worldScale": Vector3Tuple;
|
||||
"tc.worldTranslation": Vector3Tuple;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'RenderComponent';
|
||||
'rc.renderObj': {
|
||||
'##name': 'Mesh';
|
||||
'ro.batchCount': number;
|
||||
'ro.batches': RoBatches;
|
||||
'ro.debugflags': number;
|
||||
'ro.flags': number;
|
||||
'ro.notShadowOnly': boolean;
|
||||
'ro.sOclCull': boolean;
|
||||
'ro.sOclIndex': number;
|
||||
} & Record<`rb${number}.${'lodIndex' | 'switchIndex'}`, number>;
|
||||
"comp.typename": "RenderComponent";
|
||||
"rc.renderObj": {
|
||||
"##name": "Mesh";
|
||||
"ro.batchCount": number;
|
||||
"ro.batches": RoBatches;
|
||||
"ro.debugflags": number;
|
||||
"ro.flags": number;
|
||||
"ro.notShadowOnly": boolean;
|
||||
"ro.sOclCull": boolean;
|
||||
"ro.sOclIndex": number;
|
||||
} & Record<`rb${number}.${"lodIndex" | "switchIndex"}`, number>;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'SlotComponent';
|
||||
'sc.attachmentRotation': number[];
|
||||
'sc.attachmentScale': number[];
|
||||
'sc.attachmentTranslation': number[];
|
||||
'sc.configFilePath': string;
|
||||
'sc.slotName': string;
|
||||
'sc.template': string;
|
||||
'sc.typeFiltersCount': number;
|
||||
"comp.typename": "SlotComponent";
|
||||
"sc.attachmentRotation": number[];
|
||||
"sc.attachmentScale": number[];
|
||||
"sc.attachmentTranslation": number[];
|
||||
"sc.configFilePath": string;
|
||||
"sc.slotName": string;
|
||||
"sc.template": string;
|
||||
"sc.typeFiltersCount": number;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'LodComponent';
|
||||
'lc.loddist': Record<`distance${number}`, number>;
|
||||
"comp.typename": "LodComponent";
|
||||
"lc.loddist": Record<`distance${number}`, number>;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'DecorItemComponent';
|
||||
"comp.typename": "DecorItemComponent";
|
||||
drawOrder: number;
|
||||
shouldApplyCamo: boolean;
|
||||
vanishTargetAlpha: number;
|
||||
vanishWhenArmorShown: boolean;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'NewSlotComponent';
|
||||
"comp.typename": "NewSlotComponent";
|
||||
slotItemsCount: number;
|
||||
slots: {
|
||||
[key: string]: {
|
||||
@@ -171,109 +170,109 @@ export type Component =
|
||||
};
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'ScenarioComponent';
|
||||
'scenario.scriptId': string;
|
||||
"comp.typename": "ScenarioComponent";
|
||||
"scenario.scriptId": string;
|
||||
}
|
||||
| ({
|
||||
'comp.typename': 'StateSwitcherComponent';
|
||||
'ssc.activeState': number;
|
||||
'ssc.statesCount': number;
|
||||
"comp.typename": "StateSwitcherComponent";
|
||||
"ssc.activeState": number;
|
||||
"ssc.statesCount": number;
|
||||
} & Record<`ssc.state${number}`, string>)
|
||||
| {
|
||||
'comp.typename': 'CustomPropertiesComponent';
|
||||
'cpc.properties.archive': {
|
||||
'editor.donotremove': number;
|
||||
"comp.typename": "CustomPropertiesComponent";
|
||||
"cpc.properties.archive": {
|
||||
"editor.donotremove": number;
|
||||
};
|
||||
}
|
||||
| ({
|
||||
'comp.typename': 'ActionComponent';
|
||||
'ac.actionCount': number;
|
||||
"comp.typename": "ActionComponent";
|
||||
"ac.actionCount": number;
|
||||
} & Record<
|
||||
string, // 0000, 0001, ...
|
||||
{
|
||||
'act.delay': number;
|
||||
'act.delayVariation': number;
|
||||
'act.entityName': string;
|
||||
'act.event': number;
|
||||
'act.eventToTrigger': string;
|
||||
'act.motionFrameTime': number;
|
||||
'act.motionSpeed': number;
|
||||
'act.stateActivated': number;
|
||||
'act.stopAfterNRepeats': number;
|
||||
'act.stopWhenEmpty': boolean;
|
||||
'act.switchIndex': number;
|
||||
'act.type': number;
|
||||
'act.userEventId': string;
|
||||
"act.delay": number;
|
||||
"act.delayVariation": number;
|
||||
"act.entityName": string;
|
||||
"act.event": number;
|
||||
"act.eventToTrigger": string;
|
||||
"act.motionFrameTime": number;
|
||||
"act.motionSpeed": number;
|
||||
"act.stateActivated": number;
|
||||
"act.stopAfterNRepeats": number;
|
||||
"act.stopWhenEmpty": boolean;
|
||||
"act.switchIndex": number;
|
||||
"act.type": number;
|
||||
"act.userEventId": string;
|
||||
}
|
||||
>)
|
||||
| {
|
||||
'comp.typename': 'ParticleEffectComponent';
|
||||
'pe.clearOnRestart': boolean;
|
||||
'pe.effectDuration': number;
|
||||
'pe.emitters': {
|
||||
'##name': string;
|
||||
'emitter.data': {
|
||||
'emitter.id': `${number}`;
|
||||
'emitter.quality': string;
|
||||
"comp.typename": "ParticleEffectComponent";
|
||||
"pe.clearOnRestart": boolean;
|
||||
"pe.effectDuration": number;
|
||||
"pe.emitters": {
|
||||
"##name": string;
|
||||
"emitter.data": {
|
||||
"emitter.id": `${number}`;
|
||||
"emitter.quality": string;
|
||||
}[];
|
||||
'emitter.position': Vector3Tuple;
|
||||
'emitter.rotation': Vector4Tuple;
|
||||
'emitter.scale': Vector3Tuple;
|
||||
"emitter.position": Vector3Tuple;
|
||||
"emitter.rotation": Vector4Tuple;
|
||||
"emitter.scale": Vector3Tuple;
|
||||
}[];
|
||||
'pe.inheritScale': boolean;
|
||||
'pe.nestedEmitters': boolean;
|
||||
'pe.repeatsCount': number;
|
||||
'pe.startFromTime': number;
|
||||
'pe.stopWhenEmpty': boolean;
|
||||
'pe.version': number;
|
||||
'ro.flags': number;
|
||||
"pe.inheritScale": boolean;
|
||||
"pe.nestedEmitters": boolean;
|
||||
"pe.repeatsCount": number;
|
||||
"pe.startFromTime": number;
|
||||
"pe.stopWhenEmpty": boolean;
|
||||
"pe.version": number;
|
||||
"ro.flags": number;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'TankElementComponent';
|
||||
"comp.typename": "TankElementComponent";
|
||||
isDestructible: boolean;
|
||||
shouldCastShadow: boolean;
|
||||
shouldGenerateSilhouette: boolean;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'MotionComponent';
|
||||
'motion.filepath': string;
|
||||
'motion.playbackRate': number;
|
||||
'simpleMotion.repeatsCount': number;
|
||||
"comp.typename": "MotionComponent";
|
||||
"motion.filepath": string;
|
||||
"motion.playbackRate": number;
|
||||
"simpleMotion.repeatsCount": number;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'SkeletonComponent';
|
||||
"comp.typename": "SkeletonComponent";
|
||||
joints: Record<
|
||||
string, // 0000, 0001, ...
|
||||
{
|
||||
'joint.bbox.max': Vector3Tuple;
|
||||
'joint.bbox.min': Vector3Tuple;
|
||||
'joint.bindPose': [
|
||||
"joint.bbox.max": Vector3Tuple;
|
||||
"joint.bbox.min": Vector3Tuple;
|
||||
"joint.bindPose": [
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
];
|
||||
'joint.invBindPose': [
|
||||
"joint.invBindPose": [
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
Vector4Tuple,
|
||||
];
|
||||
'joint.name': string;
|
||||
'joint.parentIndex': number;
|
||||
'joint.uid': string;
|
||||
"joint.name": string;
|
||||
"joint.parentIndex": number;
|
||||
"joint.uid": string;
|
||||
}
|
||||
>;
|
||||
jointsCount: number;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'AnimationComponent';
|
||||
"comp.typename": "AnimationComponent";
|
||||
animation: bigint;
|
||||
animationTimeScale: number;
|
||||
repeatsCount: number;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'SkeletonJointBindingComponent';
|
||||
"comp.typename": "SkeletonJointBindingComponent";
|
||||
count: number;
|
||||
map: Record<
|
||||
string, // 0000, 0001, ...
|
||||
|
||||
Reference in new issue
Block a user