forked from Greatness7/binary_templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nif.bt
1682 lines (1292 loc) · 38.1 KB
/
nif.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
// File: nif.bt
// Authors: Greatness7
// Version: 1.0
// Purpose: Parse Morrowind NetImmerse Files.
// Category: Game
// File Mask: *.nif; *.kf
// ID Bytes: 4E 65 74 49 6D 6D 65 72 73 65 20 46 69 6C 65 20 46 6F 72 6D 61 74 2C 20 56 65 72 73 69 6F 6E 20 34 2E 30 2E 30 2E 32 0A 02 00 00 04
// History: https://github.com/Greatness7/binary_templates
//------------------------------------------------
LittleEndian();
/* -- Enums -- */
typedef enum {
ALPHA_NONE,
ALPHA_BINARY,
ALPHA_SMOOTH,
ALPHA_DEFAULT,
} AlphaFormat;
typedef enum {
APPLY_REPLACE,
APPLY_DECAL,
APPLY_MODULATE,
APPLY_HILIGHT,
APPLY_HILIGHT2,
} ApplyMode;
typedef enum {
AXIS_XYZ,
AXIS_XZY,
AXIS_YZX,
AXIS_YXZ,
AXIS_ZXY,
AXIS_ZYX,
AXIS_XYX,
AXIS_YZY,
AXIS_ZXZ,
} AxisOrder;
typedef enum {
DIR_NEGATIVE = -1,
DIR_POSITIVE = 1,
} BankDirection;
typedef enum {
BV_BASE = -1,
BV_SPHERE,
BV_BOX,
BV_CAPSULE,
BV_LOZENGE,
BV_UNION,
BV_HALFSPACE,
} BoundType;
typedef enum {
CLAMP_S_CLAMP_T,
CLAMP_S_WRAP_T,
WRAP_S_CLAMP_T,
WRAP_S_WRAP_T,
} ClampMode;
typedef enum {
CG_WORLD_PARALLEL,
CG_WORLD_PERSPECTIVE,
CG_SPHERE_MAP,
CG_SPECULAR_CUBE_MAP,
CG_DIFFUSE_CUBE_MAP,
} CoordGenType;
typedef enum {
DECAY_NONE,
DECAY_LINEAR,
DECAY_EXPONENTIAL,
} DecayType;
typedef enum {
FILTER_NEAREST,
FILTER_BILERP,
FILTER_TRILERP,
FILTER_NEAREST_MIPNEAREST,
FILTER_NEAREST_MIPLERP,
FILTER_BILERP_MIPNEAREST,
} FilterMode;
typedef enum {
FORCE_PLANAR,
FORCE_SPHERICAL,
} ForceType;
typedef enum {
KEY_NOINTERP,
KEY_LIN,
KEY_BEZ,
KEY_TCB,
KEY_EULER,
} KeyType;
typedef enum {
LIGHTING_E,
LIGHTING_E_A_D,
} LightingMode;
typedef enum {
FORMAT_RGB,
FORMAT_RGBA,
FORMAT_PAL,
FORMAT_PALALPHA,
FORMAT_COMPRESS1,
FORMAT_COMPRESS3,
FORMAT_COMPRESS5,
FORMAT_RGB24NONINTERLEAVED,
FORMAT_BUMP,
FORMAT_BUMPLUMA,
} PixelFormat;
typedef enum {
LAYOUT_PALETTIZED_8,
LAYOUT_HIGH_COLOR_16,
LAYOUT_TRUE_COLOR_32,
LAYOUT_COMPRESSED,
LAYOUT_BUMPMAP,
LAYOUT_PALETTIZED_4,
LAYOUT_DEFAULT,
} PixelLayout;
typedef enum {
SORTING_INHERIT,
SORTING_OFF,
SORTING_SUBSORT,
} SortingMode;
typedef enum {
SOURCE_IGNORE,
SOURCE_EMISSIVE,
SOURCE_AMB_DIFF,
} SourceVertexMode;
typedef enum {
SYM_SPHERICAL,
SYM_CYLINDRICAL,
SYM_PLANAR,
} SymmetryType;
typedef enum {
PROJECTED_LIGHT,
PROJECTED_SHADOW,
MAP_ENVIRONMENT,
MAP_FOG,
} TextureType;
typedef enum {
MIP_NO,
MIP_YES,
MIP_DEFAULT,
} UseMipMaps;
/* -- Basic Types -- */
// index of another object in the scene or -1 for none
typedef int NiLink;
// technically a memory address, but used as a boolean
typedef uint NiBool <read=NiBool_Read>;
// nif strings always come with a uint prefix for size
typedef struct {
uint size;
char value[size];
} NiString <read=NiString_Read, open=suppress>;
/* -- Math Types -- */
typedef struct {
float x;
float y;
} NiPoint2;
typedef struct {
float x;
float y;
float z;
} NiPoint3;
typedef struct {
NiPoint2 col0;
NiPoint2 col1;
} NiMatrix2;
typedef struct {
NiPoint3 col0;
NiPoint3 col1;
NiPoint3 col2;
} NiMatrix3;
typedef struct {
float w;
float x;
float y;
float z;
} NiQuaternion;
typedef struct {
float r;
float g;
float b;
} NiColor;
typedef struct {
float r;
float g;
float b;
float a;
} NiColorA;
typedef struct {
NiPoint3 normal;
float constant;
} NiPlane;
typedef struct {
float left;
float right;
float top;
float bottom;
} NiRect;
typedef struct {
float left;
float right;
float top;
float bottom;
float near;
float far;
} NiFrustum;
/* -- Main Types -- */
typedef struct {
// no fields
} NiObject <name="NiObject">;
typedef struct {
NiObject super;
} NiAccumulator <name="NiAccumulator">;
typedef struct {
NiAccumulator super;
} NiClusterAccumulator <name="NiClusterAccumulator">;
typedef struct {
NiClusterAccumulator super;
} NiAlphaAccumulator <name="NiAlphaAccumulator">;
typedef struct {
NiObject super;
NiLink nextExtraData <comment="NiExtraData">;
uint bytesRemaining;
} NiExtraData <name="NiExtraData">;
typedef struct {
NiExtraData super;
} TES3ObjectExtraData <name="TES3ObjectExtraData">;
typedef struct {
NiExtraData super;
} BrickNiExtraData <name="BrickNiExtraData">;
typedef struct {
NiExtraData super;
NiString stringData;
} NiStringExtraData <name="NiStringExtraData">;
typedef struct {
float time;
NiString value;
} NiTextKey;
typedef struct {
NiExtraData super;
uint numTextKeys;
NiTextKey textKeys[numTextKeys] <optimize=false>;
} NiTextKeyExtraData <name="NiTextKeyExtraData">;
typedef struct {
NiExtraData super;
ushort numWeights;
float weights[numWeights];
} NiVertWeightsExtraData <name="NiVertWeightsExtraData">;
typedef struct {
NiObject super;
ushort numVertices;
NiBool hasVertices;
if (hasVertices) {
NiPoint3 vertices[numVertices];
}
NiBool hasNormals;
if (hasNormals) {
NiPoint3 normals[numVertices];
}
float center;
NiPoint3 radius;
NiBool hasVertexColors;
if (hasVertexColors) {
NiColorA vertexColors[numVertices];
}
ushort numUVSets;
NiBool hasUVSets;
if (hasUVSets) {
NiPoint2 UVSets[numUVSets * numVertices];
}
} NiGeometryData <name="NiGeometryData">;
typedef struct {
NiGeometryData super;
ubyte vertexFlags[super.numVertices];
} NiLinesData <name="NiLinesData">;
typedef struct {
NiGeometryData super;
ushort activeTriangles;
} NiTriBasedGeomData <name="NiTriBasedGeomData">;
typedef struct {
NiGeometryData super;
ushort numParticles;
float particleRadius;
ushort numActive;
NiBool hasSizes;
if (hasSizes) {
float sizes[super.numVertices];
}
} NiParticlesData <name="NiParticlesData">;
typedef struct {
NiParticlesData super;
} NiAutoNormalParticlesData <name="NiAutoNormalParticlesData">;
typedef struct {
NiParticlesData super;
NiBool hasRotations;
if (hasRotations) {
NiQuaternion rotations[super.super.numVertices];
}
} NiRotatingParticlesData <name="NiRotatingParticlesData">;
typedef struct {
ushort vertexIndices[3];
} Triangle <read=Triangle_Read>;
typedef struct {
NiTriBasedGeomData super;
uint numTrianglePoints;
Triangle triangles[numTrianglePoints / 3];
ushort numSharedNormals;
struct {
ushort numVertexIndices;
ushort vertexIndices[numVertexIndices];
} sharedNormals[numSharedNormals] <optimize=false>;
} NiTriShapeData <name="NiTriShapeData">;
typedef struct {
NiTriShapeData super;
ushort activeVertices;
ushort activeTriangles;
} NiTriShapeDynamicData <name="NiTriShapeDynamicData">;
typedef struct {
NiTriBasedGeomData super;
ushort numStrips;
ushort stripLengths[numStrips];
local uint i;
for (i = 0; i < numStrips; i++) {
struct { ushort vertexIndices[stripLengths[i]]; } strips;
}
} NiTriStripsData <name="NiTriStripsData">;
typedef struct {
NiObject super;
NiString name;
NiLink extraData <comment="NiExtraData">;
NiLink controller <comment="NiTimeController">;
} NiObjectNET <name="NiObjectNET", read=NiObjectNET_Read>;
typedef struct {
NiObjectNET super;
} NiSequenceStreamHelper <name="NiSequenceStreamHelper", read=NiSequenceStreamHelper_Read>;
typedef struct {
NiObjectNET super;
} NiTexture <name="NiTexture", read=NiTexture_Read>;
typedef struct {
NiTexture super;
} NiRenderedTexture <name="NiRenderedTexture", read=NiRenderedTexture_Read>;
typedef struct {
NiRenderedTexture super;
} NiRenderedCubeMap <name="NiRenderedCubeMap", read=NiRenderedCubeMap_Read>;
typedef struct {
NiTexture super;
ubyte hasExternal;
if (hasExternal) {
NiString fileName;
} else {
ubyte hasPixelData;
if (hasPixelData) {
NiLink pixelData <comment="NiPixelData">;
}
}
PixelLayout pixelLayout;
UseMipMaps useMipMaps;
AlphaFormat alphaFormat;
ubyte isStatic;
} NiSourceTexture <name="NiSourceTexture", read=NiSourceTexture_Read>;
typedef struct {
NiObjectNET super;
ushort flags;
} NiProperty <name="NiProperty", read=NiProperty_Read>;
typedef struct {
NiProperty super;
ubyte testRef;
} NiAlphaProperty <name="NiAlphaProperty", read=NiAlphaProperty_Read>;
typedef struct {
NiProperty super;
} NiDitherProperty <name="NiDitherProperty", read=NiDitherProperty_Read>;
typedef struct {
NiProperty super;
float fogDepth;
NiColor fogColor;
} NiFogProperty <name="NiFogProperty", read=NiFogProperty_Read>;
typedef struct {
NiProperty super;
NiColor ambientColor;
NiColor diffuseColor;
NiColor specularColor;
NiColor emissiveColor;
float shine;
float alpha;
} NiMaterialProperty <name="NiMaterialProperty", read=NiMaterialProperty_Read>;
typedef struct {
NiProperty super;
} NiRendererSpecificProperty <name="NiRendererSpecificProperty", read=NiRendererSpecificProperty_Read>;
typedef struct {
NiProperty super;
} NiShadeProperty <name="NiShadeProperty", read=NiShadeProperty_Read>;
typedef struct {
NiProperty super;
} NiSpecularProperty <name="NiSpecularProperty", read=NiSpecularProperty_Read>;
typedef struct {
NiProperty super;
ubyte stencilEnabled;
uint stencilFunction;
uint stencilRef;
uint stencilMask;
uint failAction;
uint passZFailAction;
uint passAction;
uint drawMode;
} NiStencilProperty <name="NiStencilProperty", read=NiStencilProperty_Read>;
typedef struct {
NiLink sourceTexture <comment="NiSourceTexture">;
ClampMode clampMode;
FilterMode filterMode;
uint uvSet;
short ps2L;
short ps2K;
byte unknown_byte;
byte unknown_byte;
} Map;
typedef struct {
Map super;
float lumaScale;
float lumaOffset;
NiMatrix2 displacement;
} BumpMap;
typedef struct {
NiProperty super;
ApplyMode applyMode;
uint numTextureMaps;
local uint i;
for (i = 0; i < numTextureMaps; i++) {
NiBool hasMap;
if (hasMap) {
if (i == 5) { // BumpMapIndex
BumpMap bumpMap;
} else {
Map map;
}
}
}
} NiTexturingProperty <name="NiTexturingProperty", read=NiTexturingProperty_Read>;
typedef struct {
NiProperty super;
SourceVertexMode sourceVertexMode;
LightingMode lightingMode;
} NiVertexColorProperty <name="NiVertexColorProperty", read=NiVertexColorProperty_Read>;
typedef struct {
NiProperty super;
} NiWireframeProperty <name="NiWireframeProperty", read=NiWireframeProperty_Read>;
typedef struct {
NiProperty super;
} NiZBufferProperty <name="NiZBufferProperty", read=NiZBufferProperty_Read>;
typedef struct {
NiPoint3 center;
float radius;
} NiSphereBV;
typedef struct {
NiPoint3 center;
NiPoint3 axes[3];
NiPoint3 extents;
} NiBoxBV;
typedef struct {
uint numBoundingVolumes;
struct NiBoundingVolume boundingVolumes[numBoundingVolumes] <optimize=false>;
} NiUnionBV;
typedef struct {
BoundType boundType;
switch (boundType) {
case BV_SPHERE: NiSphereBV boundingVolume; break;
case BV_BOX: NiBoxBV boundingVolume; break;
case BV_UNION: NiUnionBV boundingVolume; break;
default:
Assert(false); // TODO other bound types
}
} NiBoundingVolume;
typedef struct {
NiObjectNET super;
ushort flags;
NiPoint3 translation;
NiMatrix3 rotation;
float scale;
NiPoint3 velocity;
uint numProperties;
NiLink properties[numProperties] <comment="NiProperty">;
NiBool hasBoundingVolume;
if (hasBoundingVolume) {
NiBoundingVolume boundingVolume;
}
} NiAVObject <name="NiAVObject", read=NiAVObject_Read>;
typedef struct {
NiObject super;
ushort numVertices;
NiPoint3 vertices[numVertices];
NiBool hasTexture;
if (hasTexture) {
NiPoint2 texCoords[numVertices];
}
NiBool hasColors;
if (hasColors) {
NiColorA colors[numVertices];
}
uint numPropertyStates;
NiLink propertyStates[numPropertyStates] <comment="NiPropertyState">;
} NiScreenPolygon <name="NiScreenPolygon">;
typedef struct {
NiAVObject super;
NiFrustum viewFrustum;
NiRect viewPort;
float lodAdjust;
NiLink sceneNode <comment="NiNode">;
uint numScreenPolygons;
NiLink screenPolygons[numScreenPolygons] <comment="NiScreenPolygon">;
} NiCamera <name="NiCamera", read=NiCamera_Read>;
typedef struct {
NiAVObject super;
uint numAffectedNodes;
NiLink affectedNodes[numAffectedNodes] <comment="NiNode">;
} NiDynamicEffect <name="NiDynamicEffect", read=NiDynamicEffect_Read>;
typedef struct {
NiDynamicEffect super;
NiMatrix3 modelProjectionMatrix;
NiPoint3 modelProjectionTranslation;
FilterMode textureFiltering;
ClampMode textureClamping;
TextureType textureType;
CoordGenType coordinateGenerationType;
NiLink sourceTexture <comment="NiSourceTexture">;
ubyte clippingPlaneEnable;
NiPlane clippingPlane;
ushort ps2L;
ushort ps2K;
byte unknown_byte;
byte unknown_byte;
} NiTextureEffect <name="NiTextureEffect", read=NiTextureEffect_Read>;
typedef struct {
NiDynamicEffect super;
float dimmer;
NiColor ambient_color;
NiColor diffuse_color;
NiColor specular_color;
} NiLight <name="NiLight", read=NiLight_Read>;
typedef struct {
NiLight super;
} NiAmbientLight <name="NiAmbientLight", read=NiAmbientLight_Read>;
typedef struct {
NiLight super;
} NiDirectionalLight <name="NiDirectionalLight", read=NiDirectionalLight_Read>;
typedef struct {
NiLight super;
float constantAttenuation;
float linearAttenuation;
float quadraticAttenuation;
} NiPointLight <name="NiPointLight", read=NiPointLight_Read>;
typedef struct {
NiPointLight super;
float outerSpotAngle;
float exponent;
} NiSpotLight <name="NiSpotLight", read=NiSpotLight_Read>;
typedef struct {
NiAVObject super;
NiLink geometryData <comment="NiGeometryData">;
NiLink skinInstance <comment="NiSkinInstance">;
} NiGeometry <name="NiGeometry", read=NiGeometry_Read>;
typedef struct {
NiGeometry super;
} NiLines <name="NiLines", read=NiLines_Read>;
typedef struct {
NiGeometry super;
} NiTriBasedGeom <name="NiTriBasedGeom", read=NiTriBasedGeom_Read>;
typedef struct {
NiTriBasedGeom super;
} NiTriShape <name="NiTriShape", read=NiTriShape_Read>;
typedef struct {
NiGeometry super;
} NiParticles <name="NiParticles", read=NiParticles_Read>;
typedef struct {
NiParticles super;
} NiAutoNormalParticles <name="NiAutoNormalParticles", read=NiAutoNormalParticles_Read>;
typedef struct {
NiParticles super;
} NiRotatingParticles <name="NiRotatingParticles", read=NiRotatingParticles_Read>;
typedef struct {
NiTriBasedGeom super;
} NiTriStrips <name="NiTriStrips", read=NiTriStrips_Read>;
typedef struct {
NiAVObject super;
uint numChildren;
NiLink children[numChildren] <comment="NiAVObject">;
uint numEffects;
NiLink effects[numEffects] <comment="NiDynamicEffect">;
} NiNode <name="NiNode", read=NiNode_Read>;
typedef struct {
NiNode super;
} AvoidNode <name="AvoidNode", read=AvoidNode_Read>; // Bethesda
typedef struct {
NiNode super;
} BSMirroredNode <name="BSMirroredNode", read=BSMirroredNode_Read>; // Bethesda
typedef struct {
NiNode super;
} RootCollisionNode <name="RootCollisionNode", read=RootCollisionNode_Read>; // Bethesda
typedef struct {
NiNode super;
} NiBillboardNode <name="NiBillboardNode", read=NiBillboardNode_Read>;
typedef struct {
NiNode super;
} NiBSAnimationNode <name="NiBSAnimationNode", read=NiBSAnimationNode_Read>; // Bethesda
typedef struct {
NiNode super;
} NiBSAnimationManager <name="NiBSAnimationManager", read=NiBSAnimationManager_Read>; // Bethesda
typedef struct {
NiBSAnimationNode super;
} NiBSParticleNode <name="NiBSParticleNode", read=NiBSParticleNode_Read>; // Bethesda
typedef struct {
NiNode super;
NiPlane modelPlane;
} NiBSPNode <name="NiBSPNode", read=NiBSPNode_Read>;
typedef struct {
NiNode super;
} NiCollisionSwitch <name="NiCollisionSwitch", read=NiCollisionSwitch_Read>;
typedef struct {
NiNode super;
SortingMode sortingMode;
NiLink accumulator <comment="NiAccumulator">;
} NiSortAdjustNode <name="NiSortAdjustNode", read=NiSortAdjustNode_Read>;
typedef struct {
NiNode super;
uint activeIndex;
} NiSwitchNode <name="NiSwitchNode", read=NiSwitchNode_Read>;
typedef struct {
NiSwitchNode super;
float period;
} NiFltAnimationNode <name="NiFltAnimationNode", read=NiFltAnimationNode_Read>;
typedef struct {
NiSwitchNode super;
NiPoint3 LODCenter;
uint numLODLevels;
struct { float near; float far; } LODLevels[numLODLevels];
} NiLODNode <name="NiLODNode", read=NiLODNode_Read>;
typedef struct {
NiObject super;
NiLink nextModifier <comment="NiParticleModifier">;
NiLink controller <comment="NiTimeCintroller">;
} NiParticleModifier <name="NiParticleModifier">;
typedef struct {
NiParticleModifier super;
float decay;
float strength;
ForceType forceType;
NiPoint3 position;
NiPoint3 direction;
} NiGravity <name="NiGravity">;
typedef struct {
NiParticleModifier super;
float decay;
float duration;
float delta_v;
float start_time;
DecayType decayType;
SymmetryType symmetryType;
NiPoint3 position;
NiPoint3 direction;
} NiParticleBomb <name="NiParticleBomb">;
typedef struct {
NiParticleModifier super;
float bounce;
} NiParticleCollider <name="NiParticleCollider">;
typedef struct {
NiParticleCollider super;
float height;
float width;
NiPoint3 position;
NiPoint3 x_axis;
NiPoint3 y_axis;
NiPlane plane;
} NiPlanarCollider <name="NiPlanarCollider">;
typedef struct {
NiParticleCollider super;
float radius;
NiPoint3 position;
} NiSphericalCollider <name="NiSphericalCollider">;
typedef struct {
NiParticleModifier super;
NiLink colorData <comment="NiColorData">;
} NiParticleColorModifier <name="NiParticleColorModifier">;
typedef struct {
NiParticleModifier super;
float growTime;
float fadeTime;
} NiParticleGrowFade <name="NiParticleGrowFade">;
typedef struct {
NiParticleModifier super;
ubyte randomInitialAxis;
NiPoint3 initialAxis;
float rotationSpeed;
} NiParticleRotation <name="NiParticleRotation">;
typedef struct {
PixelFormat pixelFormat;
uint colorMasks[4];
uint bitsPerPixel;
ubyte oldFastCompare[8];
} NiPixelFormat;
typedef struct {
NiObject super;
NiPixelFormat pixelFormat;
NiLink palette <comment="NiPalette">;
uint numMipMapLevels;
uint pixelStride;
uint mipMaps[numMipMapLevels * 3];
uint numPixels;
ubyte pixelData[numPixels];
} NiPixelData <name="NiPixelData">;
typedef struct {
NiObject super;
ubyte hasExternal;
if (hasExternal) {
NiString fileName;
} else {
ubyte hasPixelData;
if (hasPixelData) {
NiLink pixelData <comment="NiPixelData">;
}
}
} NiBltSource <name="NiBltSource">;
typedef struct {
NiObject super;
} NiRenderer <name="NiRenderer">;
typedef struct {
NiObject super;
} NiDX8Renderer <name="NiDX8Renderer">;
typedef struct {
NiObject super;
NiLink nextController <comment="NiTimeController">;
ushort flags;
float frequency;
float phase;
float startTime;
float stopTime;
NiLink target <comment="NiObjectNET">;
} NiTimeController <name="NiTimeController">;
typedef struct {
NiTimeController super;
uint affectedMap;
float flipStartTime;
float secsPerFrame;