/
havok.h
1795 lines (1589 loc) · 44.4 KB
/
havok.h
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
#pragma once
typedef AlignedVector4 hkVector4;
struct alignas(16) hkQuaternion
{
float x, y, z, w;
hkQuaternion() {}
hkQuaternion(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w) {}
hkQuaternion(const hkQuaternion &from) {*this = from;}
hkQuaternion(const NiVector3 &pry) {*this = pry;}
hkQuaternion(const NiMatrix33 &rotMat) {*this = rotMat;}
hkQuaternion(const hkMatrix3x4 &rotMat) {*this = rotMat;}
hkQuaternion(const hkVector4 &from) {*this = from;}
hkQuaternion(const AxisAngle &axisAngle) {*this = axisAngle;}
hkQuaternion(const NiQuaternion &niQt) {*this = niQt;}
hkQuaternion(const __m128 rhs) {*this = rhs;}
inline void operator=(const hkQuaternion &from) {_mm_store_ps(*this, from.PS());}
inline void operator=(hkQuaternion &&from) {_mm_store_ps(*this, from.PS());}
inline void operator=(const NiVector3 &pry) {FromEulerPRY(pry.PS());}
inline void operator=(const NiMatrix33 &rotMat) {FromRotationMatrix(rotMat);}
inline void operator=(const hkMatrix3x4 &rotMat) {ThisCall(0xCB26E0, this, &rotMat);}
inline void operator=(const hkVector4 &from) {_mm_store_ps(*this, from.PS());}
inline void operator=(const AxisAngle &axisAngle) {FromAxisAngle(axisAngle);}
inline hkQuaternion& operator=(__m128 rhs)
{
_mm_store_ps(*this, rhs);
return *this;
}
inline void operator=(const NiQuaternion &niQt)
{
__m128 m = niQt.PS();
_mm_store_ps(*this, _mm_shuffle_ps(m, m, 0x39));
}
inline __m128 operator+(const hkQuaternion &rhs) const {return PS() + rhs.PS();}
inline __m128 operator-(const hkQuaternion &rhs) const {return PS() - rhs.PS();}
inline __m128 operator*(float s) const {return PS() * _mm_set_ps1(s);}
inline __m128 operator*(const hkQuaternion &rhs) const {return MultiplyQuaternion(rhs);}
inline __m128 operator*(__m128 vec) const {return MultiplyVector(vec);}
inline hkQuaternion& operator+=(const hkQuaternion &rhs) {return *this = *this + rhs;}
inline hkQuaternion& operator-=(const hkQuaternion &rhs) {return *this = *this - rhs;}
inline hkQuaternion& operator*=(float s) {return *this = *this * s;}
inline hkQuaternion& operator*=(const hkQuaternion &rhs) {return *this = *this * rhs;}
inline operator float*() {return &x;}
inline __m128 PS() const {return _mm_load_ps(&x);}
inline bool operator==(const hkQuaternion &rhs) const {return Equal_V4(PS(), rhs.PS());}
inline bool operator!=(const hkQuaternion &rhs) const {return !(*this == rhs);}
hkQuaternion& __vectorcall FromEulerPRY(__m128 pry);
hkQuaternion& __fastcall FromRotationMatrix(const NiMatrix33 &rotMat);
hkQuaternion& __fastcall FromAxisAngle(const AxisAngle &axisAngle);
__m128 __vectorcall MultiplyVector(__m128 vec) const;
__m128 __vectorcall MultiplyQuaternion(const hkQuaternion &rhs) const;
inline __m128 Invert() const {return PS() ^ _mm_load_ps((const float*)0x10C4C00);}
inline __m128 Negate() const {return PS() ^ GET_PS(2);}
inline float __vectorcall DotProduct(const hkQuaternion &rhs) const
{
__m128 k = _mm_setzero_ps();
return _mm_cvtss_f32(_mm_hadd_ps(_mm_hadd_ps(PS() * rhs.PS(), k), k));
}
hkQuaternion& Normalize() {return *this = Normalize_V4(PS());}
__m128 __vectorcall ToEulerPRY() const;
__m128 __vectorcall ToEulerYPR() const;
void Dump() const;
};
// 30
struct alignas(16) hkMatrix3x4
{
float cr[3][4];
hkMatrix3x4() {}
hkMatrix3x4(float m00, float m10, float m20, float m01, float m11, float m21, float m02, float m12, float m22)
{
cr[0][0] = m00; cr[0][1] = m10; cr[0][2] = m20;
cr[1][0] = m01; cr[1][1] = m11; cr[1][2] = m21;
cr[2][0] = m02; cr[2][1] = m12; cr[2][2] = m22;
}
hkMatrix3x4(const NiMatrix33 &inMatrix) {*this = inMatrix;}
hkMatrix3x4(const hkQuaternion &inQuaternion) {*this = inQuaternion;}
hkMatrix3x4(const hkMatrix3x4 &inMatrix) {*this = inMatrix;}
void __fastcall operator=(const NiMatrix33 &inMatrix);
void __fastcall operator=(const hkQuaternion &inQuaternion);
inline void operator=(const hkMatrix3x4 &from)
{
_mm_store_ps(&cr[0][0], _mm_load_ps(&from.cr[0][0]));
_mm_store_ps(&cr[1][0], _mm_load_ps(&from.cr[1][0]));
_mm_store_ps(&cr[2][0], _mm_load_ps(&from.cr[2][0]));
}
inline operator float*() const {return (float*)this;}
__m128 __vectorcall MultiplyVector(__m128 vec) const;
__m128 __vectorcall MultiplyVectorInv(__m128 vec) const;
void Dump() const;
};
// 40
struct hkTransform
{
hkMatrix3x4 rotation; // 00
hkVector4 translation; // 30
};
// 50
struct hkSweptTransform
{
hkVector4 centerOfMass0; // 00 (40)
hkVector4 centerOfMass1; // 10 (50)
hkQuaternion rotation0; // 20 (60)
hkQuaternion rotation1; // 30 (70)
hkVector4 centerOfMassLoc;// 40 (80)
};
// B0
struct hkMotionState
{
enum SolverDeactivation
{
kSolver_Max,
kSolver_Off,
kSolver_Low,
kSolver_Medium,
kSolver_High
};
hkTransform transform; // 00
hkSweptTransform sweptTransform; // 40
hkVector4 deltaAngle; // 90
float objectRadius; // A0 For spheres: actual radius * tan(PI/3)
float linearDamping; // A4
float angularDamping; // A8
UInt8 byteAC; // AC
UInt8 byteAD; // AD
UInt8 solverDeactivation; // AE
UInt8 byteAF; // AF
};
static_assert(sizeof(hkMotionState) == 0xB0);
// 0C
template <typename T_Data> class hkArray
{
Use_ArrayUtils(hkArray, T_Data)
public:
enum
{
kFlag_NoDealloc = 0x80000000, // data not owned by us
kFlag_Locked = 0x40000000, // will never be destroyed
};
T_Data *data; // 00
UInt32 size; // 04
UInt32 capacityAndFlags; // 08
UInt32 Size() const {return size;}
bool Empty() const {return !size;}
T_Data *Data() const {return const_cast<T_Data*>(data);}
T_Data& operator[](UInt32 index) {return data[index];}
class Iterator
{
T_Data *pData;
UInt32 count;
public:
explicit operator bool() const {return count != 0;}
void operator++()
{
pData++;
count--;
}
T_Data& operator*() const {return *pData;}
T_Data& operator->() const {return *pData;}
T_Data& Get() const {return *pData;}
Iterator(hkArray &source) : pData(source.data), count(source.size) {}
};
Iterator Begin() {return Iterator(*this);}
};
enum CollisionLayerTypes
{
LAYER_STATIC = 1,
LAYER_ANIM_STATIC,
LAYER_TRANSPARENT,
LAYER_CLUTTER,
LAYER_WEAPON,
LAYER_PROJECTILE,
LAYER_SPELL,
LAYER_BIPED,
LAYER_TREES,
LAYER_PROPS,
LAYER_WATER,
LAYER_TRIGGER,
LAYER_TERRAIN,
LAYER_TRAP,
LAYER_NONCOLLIDABLE,
LAYER_CLOUD_TRAP,
LAYER_GROUND,
LAYER_PORTAL,
LAYER_DEBRIS_SMALL,
LAYER_DEBRIS_LARGE,
LAYER_ACOUSTIC_SPACE,
LAYER_ACTORZONE,
LAYER_PROJECTILEZONE,
LAYER_GASTRAP,
LAYER_SHELLCASING,
LAYER_TRANSPARENT_SMALL,
LAYER_INVISIBLE_WALL,
LAYER_TRANSPARENT_SMALL_ANIM,
LAYER_DEADBIP,
LAYER_CHARCONTROLLER,
LAYER_AVOIDBOX,
LAYER_COLLISIONBOX,
LAYER_CAMERASPHERE,
LAYER_DOORDETECTION,
LAYER_CAMERAPICK,
LAYER_ITEMPICK,
LAYER_LINEOFSIGHT,
LAYER_PATHPICK,
LAYER_CUSTOMPICK1,
LAYER_CUSTOMPICK2,
LAYER_SPELLEXPLOSION,
LAYER_DROPPINGPICK,
LAYER_MAX
};
// 04
class hkBaseObject
{
public:
/*00*/virtual void Destroy(bool doFree);
};
// 08
class hkReferencedObject : public hkBaseObject
{
public:
/*04*/virtual void CalcStatistics(hkStatisticsCollector *collector);
/*08*/virtual void Unk_02(void);
UInt16 sizeAndFlags; // 04
UInt16 refCount; // 06
};
// 10
struct hkCdBody
{
hkpShape *shape; // 00
UInt32 shapeKey; // 04
hkMotionState *motion; // 08
hkCdBody *parent; // 0C
hkpWorldObject *GetWorldObj() const {return (hkpWorldObject*)((UInt8*)this - 0x10);}
};
// 80
struct ContactData
{
UInt16 unk00;
UInt16 flags;
UInt32 key;
hkpSimpleConstraintContactMgr *contactMgr;
UInt32 unk0C;
hkCdBody *cdBody1;
hkCdBody *cdBody2;
UInt32 unk18[26];
};
// 08
struct CdBodyLinker
{
ContactData *data;
hkCdBody *cdBody;
};
// 10
struct CdParentObj
{
NiRTTI *type; // 00 0x1267B70 (bhkNiCollisionObject) / 0x11F4280 (NiAVObject) / 0x11F4A20 (NiTriStrips)
UInt32 unk04; // 04
NiObject *object; // 08 bhkNiCollisionObject or NiAVObject
UInt32 unk0C; // 0C
};
// 70
struct hkCdPoint
{
NiVector4 point00; // 00
NiVector4 point10; // 10
hkCdBody *cdBody1; // 20
UInt8 body1Key; // 24
UInt8 pad25[2]; // 25
UInt8 obj1Flag; // 27
NiVector4 point28; // 28
NiVector4 point38; // 38
hkCdBody *cdBody2; // 48
UInt8 body2Key; // 4C
UInt8 pad4D[2]; // 4D
UInt8 obj2Flag; // 4F
NiVector4 point50; // 50
NiVector4 point60; // 60
};
// 04
class hkpEntityListener
{
public:
/*00*/virtual void Destroy(bool doFree);
/*04*/virtual void Unk_01(UInt32 arg);
/*08*/virtual void Unk_02(hkpRigidBody *rigidBody);
/*0C*/virtual void Unk_03(UInt32 arg);
/*10*/virtual void Unk_04(UInt32 arg);
/*14*/virtual void Unk_05(UInt32 arg);
};
// 10
class bhkEntityListener : public hkpEntityListener
{
public:
/*18*/virtual void Unk_06(UInt32 arg);
/*1C*/virtual bool Unk_07(hkCdPoint *cdPoint);
/*20*/virtual bool Unk_08(hkCdPoint *cdPoint);
/*24*/virtual UInt32 Unk_09(UInt32 arg);
UInt32 unk04; // 04
UInt8 byte08; // 08
UInt8 pad09[3]; // 09
UInt32 unk0C; // 0C
};
// 28
class BGSAcousticSpaceListener : public bhkEntityListener
{
public:
/*28*/virtual bool Unk_0A(UInt32 arg1, UInt32 arg2);
/*2C*/virtual bool Unk_0B(UInt32 arg1, UInt32 arg2);
UInt32 unk10; // 10
UInt8 byte14; // 14
UInt8 pad15[3]; // 15
NiTMap<TESObjectREFR*, int> refrMap; // 18
};
static_assert(sizeof(BGSAcousticSpaceListener) == 0x28);
// 04
class hkpPhantomListener
{
public:
/*00*/virtual void Unk_00(void);
/*04*/virtual void Unk_01(void);
/*08*/virtual void Unk_02(void);
/*0C*/virtual void Unk_03(void);
/*10*/virtual void Unk_04(void);
};
// D0
class hkpCharacterProxy : public hkReferencedObject
{
public:
/*0C*/virtual void Unk_03(void);
/*10*/virtual void Unk_04(void);
hkpEntityListener entityListener; // 08
hkpPhantomListener phantomListener; // 0C
hkVector4 velocity; // 10
hkVector4 vector20; // 20
hkpCachingShapePhantom *shapePhantom; // 30
UInt32 unk34[16]; // 34
hkArray<hkCdPoint> cdPoints; // 74
hkArray<UInt32> arr80; // 80
hkArray<UInt32> arr8C; // 8C
hkArray<UInt32> arr98; // 98
UInt32 unkA4[11]; // A4
};
static_assert(sizeof(hkpCharacterProxy) == 0xD0);
// D0
class ahkpCharacterProxy : public hkpCharacterProxy
{
public:
};
// 8C
class hkpWorldObject : public hkReferencedObject
{
public:
/*0C*/virtual void SetShape(hkpShape *shape);
/*10*/virtual hkMotionState *GetMotionState();
enum FilterFlags
{
kFilterFlag_Scaled = 0x20,
kFilterFlag_NoCollision = 0x40,
kFilterFlag_Linked = 0x80
};
hkpWorld *pWorld; // 08
bhkWorldObject *object; // 0C
hkCdBody cdBody; // 10
SInt8 byte20; // 20 Offset modifier from cdBody offset to object begin offset
UInt8 byte21; // 21
UInt16 word22; // 22
UInt32 unk24; // 24
UInt8 collisionType; // 28 Known: 1 - hkpRigidBody, 2 - hkpPhantom
UInt8 byte29; // 29
UInt8 byte2A; // 2A
UInt8 pad2B; // 2B
UInt8 layerType; // 2C
UInt8 filterFlags; // 2D
UInt16 group; // 2E
NiVector4 vector30; // 30
NiVector4 vector40; // 40
UInt32 unk50; // 50
UInt32 *unk54; // 54
UInt32 *unk58; // 58
float penetrateDepth; // 5C
hkArray<CdBodyLinker> cdRgdBodies; // 60
UInt32 unk6C[3]; // 6C
hkArray<CdParentObj> parentObjs; // 78
UInt32 unk84[2]; // 84
NiNode *GetParentNode();
TESObjectREFR *GetParentRef();
};
static_assert(sizeof(hkpWorldObject) == 0x8C);
struct hkDiagonal
{
hkVector4 pt0;
hkVector4 pt1;
};
// 10
class hkpShape : public hkReferencedObject
{
public:
/*0C*/virtual void Unk_03(hkVector4 *arg1);
/*10*/virtual UInt32 Unk_04();
/*14*/virtual bool IsConvex();
/*18*/virtual UInt32 Unk_06(UInt32 arg1, UInt32 arg2);
/*1C*/virtual void GetSpaceDiagonal(hkTransform *arg1, float arg2, hkDiagonal *resPtr);
/*20*/virtual void *Unk_08(void *arg1, hkVector4 *arg2, void *arg3);
/*24*/virtual void Unk_09(void *arg1, void *arg2, void *arg3);
/*28*/virtual void Unk_0A(hkVector4 *arg1, hkVector4 *arg2, void *arg3, hkVector4 *arg4);
/*2C*/virtual UInt32 Unk_0B();
bhkShape *shape; // 08
UInt32 unk0C; // 0C
};
static_assert(sizeof(hkpShape) == 0x10);
// 0C
class bhkRefObject : public NiObject
{
public:
/*8C*/virtual void SetObject(hkReferencedObject *object);
/*90*/virtual void UpdateRefCount(bool incRef); // inc/dec ref, depending on arg
hkReferencedObject *refObject; // 08
};
// 10
class bhkSerializable : public bhkRefObject
{
public:
/*94*/virtual void Unk_25(UInt32 arg);
/*98*/virtual hkpWorld *GetWorld(void);
/*9C*/virtual bool SetWorld(bhkWorld *inWorld);
/*A0*/virtual bool Unk_28(void);
/*A4*/virtual void FreeData(bool del); // free hkData
/*A8*/virtual UInt32 Unk_2A(void);
/*AC*/virtual void LoadHavokData(NiStream *stream); // called from bhkSerializable::Load after primary load is done
/*B0*/virtual void Unk_2C(void); // create object
/*B4*/virtual void *CreateHavokData(UInt8 *arg); // create Cinfo, return hkData
/*B8*/virtual void Unk_2E(void); // destroy object
/*BC*/virtual void Unk_2F(void);
/*C0*/virtual void Unk_30(void);
void *hkData; // 0C - stores hkConstraintData (descriptor used to build hkObj)
};
// 14
class bhkWorldObject : public bhkSerializable
{
public:
/*C4*/virtual void UpdateCollisionFilter();
/*C8*/virtual void Unk_32(void);
/*CC*/virtual void Unk_33(void);
/*D0*/virtual void Unk_34(void);
UInt32 bodyFlags; // 10
void __fastcall ApplyForce(const NiVector4 &forceVector);
};
// 18
class bhkPhantom : public bhkWorldObject
{
public:
UInt32 unk14; // 14
};
// 18
class bhkAabbPhantom : public bhkPhantom
{
public:
};
// 18
class bhkShapePhantom : public bhkPhantom
{
public:
};
struct hkEdge
{
hkVector4 point;
float epsilon0;
float epsilon1;
};
// 18
class bhkSimpleShapePhantom : public bhkShapePhantom
{
public:
__forceinline void CollectCdPoints(hkVector4 *point0, hkEdge *point1, hkpAllCdPointCollector *collector)
{
ThisCall(0xC9EBA0, this, point0, point1, collector, nullptr);
}
};
class bhkCachingShapePhantom : public bhkShapePhantom
{
public:
};
// 18
class hkpShapeContainer
{
public:
/*00*/virtual void Destroy(bool doFree);
/*04*/virtual UInt32 GetSize();
/*08*/virtual void Unk_02(void);
/*0C*/virtual void Unk_03(void);
/*10*/virtual void Unk_04(void);
/*14*/virtual void Unk_05(void);
/*18*/virtual void Unk_06(void);
// 10
struct ShapeItem
{
hkpShape *shape; // 00
UInt32 unk04[3]; // 04
};
UInt32 unk04; // 04
hkArray<ShapeItem> shapes; // 08
UInt16 word14; // 14
UInt16 sizeMod; // 16
};
static_assert(sizeof(hkpShapeContainer) == 0x18);
class hkpSingleShapeContainer : public hkpShapeContainer
{
public:
};
// 14
class bhkShape : public bhkSerializable
{
public:
/*C4*/virtual void Unk_31(void);
/*C8*/virtual void Unk_32(void);
/*CC*/virtual void Unk_33(void);
/*D0*/virtual void Unk_34(void);
/*D4*/virtual void Unk_35(void);
/*D8*/virtual void Unk_36(void);
/*DC*/virtual void Unk_37(void);
/*E0*/virtual void Unk_38(void);
UInt32 materialType; // 10
};
// 14
class bhkTransformShape : public bhkShape
{
public:
};
// 10
class bhkConstraint : public bhkSerializable
{
public:
/*C4*/virtual void Unk_31(void);
/*C8*/virtual void Unk_32(void);
/*CC*/virtual void Unk_33(void);
/*D0*/virtual void Unk_34(void);
/*D4*/virtual void Unk_35(void);
};
// 10
class bhkLimitedHingeConstraint : public bhkConstraint
{
public:
};
struct hkpCdBodyPair
{
hkCdBody *cdBody1;
UInt32 unk04;
hkCdBody *cdBody2;
UInt32 unk0C;
};
// 14
class hkpCdBodyPairCollector
{
public:
/*00*/virtual void Destroy(bool doFree);
/*04*/virtual void Unk_01(void);
/*08*/virtual void Unk_02(void);
UInt32 unk04; // 04
hkArray<hkpCdBodyPair> cdPairs; // 08
};
// 114
class hkpAllCdBodyPairCollector : public hkpCdBodyPairCollector
{
public:
hkpCdBodyPair cdPairsLoc[16]; // 14
};
static_assert(sizeof(hkpAllCdBodyPairCollector) == 0x114);
// A4
class hkpPhantom : public hkpWorldObject
{
public:
/*14*/virtual UInt32 PhantomType();
/*18*/virtual void Unk_06(void);
/*1C*/virtual void Unk_07(void);
/*20*/virtual void Unk_08(void);
/*24*/virtual void Unk_09(void);
/*28*/virtual void Unk_0A(void);
/*2C*/virtual void Unk_0B(void);
/*30*/virtual void Unk_0C(void);
/*34*/virtual void Unk_0D(void);
enum PhantomType
{
kPhantom_Aabb,
kPhantom_SimpleShape,
kPhantom_CachingShape
};
UInt32 unk8C[6]; // 8C
};
static_assert(sizeof(hkpPhantom) == 0xA4);
// E0
class hkpAabbPhantom : public hkpPhantom
{
public:
UInt32 unkA4[11]; // A4
hkArray<hkCdBody*> cdBodies; // D0
UInt32 unkDC; // DC
};
static_assert(sizeof(hkpAabbPhantom) == 0xE0);
// 160
class hkpShapePhantom : public hkpPhantom
{
public:
/*38*/virtual void CollectCdPoints(hkVector4 *point0, hkEdge *point1, hkpAllCdPointCollector *collector0, hkpAllCdPointCollector *collector1);
/*3C*/virtual void Unk_0F(hkTransform *transform, hkEdge *point1, hkpAllCdPointCollector *collector0, hkpAllCdPointCollector *collector1);
/*40*/virtual void Unk_10(hkpCdBodyPairCollector *pairCollector, UInt32 arg2);
/*44*/virtual void GetCdBodyData(hkpCdBodyPairCollector *pairCollector, UInt32 arg2);
UInt32 unk0A4[3]; // 0A4
hkMotionState motionState; // 0B0
};
static_assert(sizeof(hkpShapePhantom) == 0x160);
// 170
class hkpSimpleShapePhantom : public hkpShapePhantom
{
public:
hkArray<hkCdBody*> cdBodies; // 160
UInt8 byte16C; // 16C
UInt8 pad16D[3]; // 16D
};
static_assert(sizeof(hkpSimpleShapePhantom) == 0x170);
// 170
class hkpCachingShapePhantom : public hkpShapePhantom
{
public:
hkArray<CdBodyLinker> cdBodies; // 160
UInt32 unk16C; // 16C
};
static_assert(sizeof(hkpCachingShapePhantom) == 0x170);
class hkpConstraintOwner : public hkReferencedObject
{
public:
/*0C*/virtual void Unk_03(void);
/*10*/virtual void Unk_04(void);
/*14*/virtual void Unk_05(void);
/*18*/virtual void Unk_06(void);
};
// 6C
class hkpSimulationIsland : public hkpConstraintOwner
{
public:
UInt32 unk08[4]; // 08
ahkpWorld *world; // 18
UInt32 unk1C[11]; // 1C
hkArray<hkpRigidBody*> rigidBodies; // 48
hkpRigidBody *rgdBody54; // 54
UInt32 unk58; // 58
hkArray<ContactData*> contactData; // 5C
ContactData *data68; // 68
};
// 14
class hkpBroadPhase : public hkReferencedObject
{
public:
/*0C*/virtual void Unk_03(void);
/*10*/virtual void Unk_04(void);
/*14*/virtual void Unk_05(void);
/*18*/virtual void Unk_06(void);
/*1C*/virtual void Unk_07(void);
/*20*/virtual void Unk_08(void);
/*24*/virtual void Unk_09(void);
/*28*/virtual void Unk_0A(void);
/*2C*/virtual void Unk_0B(void);
/*30*/virtual void Unk_0C(void);
/*34*/virtual void Unk_0D(void);
/*38*/virtual void Unk_0E(void);
/*3C*/virtual void Unk_0F(void);
/*40*/virtual void Unk_10(void);
/*44*/virtual void Unk_11(void);
/*48*/virtual void Unk_12(void);
/*4C*/virtual void Unk_13(void);
/*50*/virtual void Unk_14(void);
/*54*/virtual void Unk_15(void);
/*58*/virtual void Unk_16(void);
/*5C*/virtual void Unk_17(void);
/*60*/virtual void Unk_18(void);
/*64*/virtual void Unk_19(void);
/*68*/virtual void Unk_1A(void);
/*6C*/virtual void Unk_1B(void);
/*70*/virtual void Unk_1C(void);
UInt32 unk08; // 08
UInt16 word0C; // 0C
UInt16 word0E; // 0E
UInt32 unk10; // 10
};
// E0
class hkp3AxisSweep : public hkpBroadPhase
{
public:
/*74*/virtual void Unk_1D(void);
UInt32 unk14[11]; // 14
hkVector4 vector40; // 40
hkVector4 vector50; // 50
hkVector4 vector60; // 60
UInt32 unk70[13]; // 70
UInt16 wordA4; // A4
UInt16 wordA6; // A6
UInt32 unkA8[2]; // A8
UInt16 wordB0; // B0
UInt16 wordB2; // B2
UInt32 unkB4[2]; // B4
UInt16 wordBC; // BC
UInt16 wordBE; // BE
UInt32 unkC0[2]; // C0
UInt16 wordC8; // C8
UInt16 wordCA; // CA
UInt32 unkCC[4]; // CC
float fltDC; // DC
};
static_assert(sizeof(hkp3AxisSweep) == 0xE0);
// 1B8
class hkpWorld : public hkReferencedObject
{
public:
struct UnkStruct
{
float flt00;
float flt04;
float flt08;
float flt0C;
float flt10;
float flt14;
UInt16 word18;
UInt16 word1A;
};
hkpContinuousSimulation *simulation; // 008
float flt00C; // 00C
hkVector4 gravity; // 010
hkpSimulationIsland *fixedIsland; // 020
hkpRigidBody *fixedRigidBody; // 024
hkArray<hkpSimulationIsland*> activeSimulationIslands; // 028
hkArray<hkpSimulationIsland*> inactiveSimulationIslands; // 034
hkArray<hkpSimulationIsland*> dirtySimulationIslands; // 040
hkpDefaultWorldMaintenanceMgr *maintenanceMgr; // 04C
UInt32 unk050; // 050
UInt8 byte054; // 054
UInt8 pad055[3]; // 055
hkpBroadPhase *broadPhase; // 058
UInt32 unk05C; // 05C
UInt8 byte060; // 060
UInt8 pad061[3]; // 061
hkpBroadPhaseListener **broadPhaseListeners; // 064
hkpPhantomBroadPhaseListener *phantomBroadPhaseListener; // 068
hkpEntityEntityBroadPhaseListener *entityBroadPhaseListener; // 06C
hkpBroadPhaseBorderListener *broadPhaseBorderListener; // 070
void *ptr074; // 074
void *ptr078; // 078
bhkCollisionFilter *collisionFilter; // 07C
hkpCollisionDispatcher *collisionDispatcher; // 080
hkpDefaultConvexListFilter *convexListFilter; // 084
void *ptr088; // 088
UInt32 unk08C; // 08C
UInt32 unk090; // 090
void *ptr094; // 094
UInt32 unk098; // 098
UInt8 byte09C; // 09C
UInt8 byte09D; // 09D
UInt8 pad09E[2]; // 09E
UInt32 unk0A0; // 0A0
UInt8 byte0A4; // 0A4
UInt8 pad0A5[3]; // 0A5
UInt32 unk0A8; // 0A8
UInt16 word0AC; // 0AC
UInt8 pad0AE[2]; // 0AE
UInt8 byte0B0; // 0B0
UInt8 byte0B1; // 0B1
UInt8 pad0B2[2]; // 0B2
UInt32 unk0B4[5]; // 0B4
UInt8 byte0C8; // 0C8
UInt8 pad0C9[3]; // 0C9
float flt0CC; // 0CC
float flt0D0; // 0D0
UInt8 byte0D4; // 0D4
UInt8 byte0D5; // 0D5
UInt8 byte0D6; // 0D6
UInt8 pad0D7; // 0D7
float flt0D8; // 0D8
float flt0DC; // 0DC
UInt32 unk0E0; // 0E0
UInt8 byte0E4; // 0E4
UInt8 pad0E5[3]; // 0E5
UInt32 unk0E8[3]; // 0E8
float flt0F4[4]; // 0F4
UInt32 unk104[3]; // 104
hkArray<hkpPhantom*> phantoms; // 110
UInt32 unk11C[3]; // 11C
hkArray<hkpEntityListener*> entityListeners1; // 128
hkArray<hkpEntityListener*> entityListeners2; // 134
UInt32 unk140[6]; // 140
hkArray<hkpContactListener*> contactListeners; // 158
UInt32 unk164[15]; // 164
hkArray<hkpContactListener*> collisionListeners; // 1A0
UInt32 unk1AC[9]; // 1AC
float flt1D0[5]; // 1D0
UInt32 unk1E4[23]; // 1E4
float flt240; // 240
UnkStruct unkStruct[6]; // 244
float flt2EC; // 2EC
float flt2F0; // 2F0
UInt32 unk2F4[2]; // 2F4
float flt2FC; // 2FC
float flt300; // 300
UInt8 byte304; // 304
UInt8 byte305; // 305
UInt8 byte306; // 306
UInt8 byte307; // 307
float flt308; // 308
UInt32 unk30C; // 30C
hkVector4 vector310; // 310
hkVector4 vector320; // 320
UInt32 unk330[4]; // 330
UInt8 byte340; // 340
UInt8 pad341[3]; // 341
UInt32 unk344[3]; // 344
};
static_assert(sizeof(hkpWorld) == 0x350);
// 360
class ahkpWorld : public hkpWorld
{
public:
bhkWorld *world; // 350
UInt32 unk354[3]; // 354
};
static_assert(sizeof(ahkpWorld) == 0x360);
// 94
class bhkWorld : public bhkSerializable
{
public:
/*C4*/virtual void Update();
/*C8*/virtual void PickObject(void *arPickData);
/*CC*/virtual void Unk_33();
/*D0*/virtual void AddObject(NiAVObject *object, bool bRecurse, bool bNotify, int group, bool bForce);
/*D4*/virtual void Unk_35(void*, NiObjectNET*);
/*D8*/virtual void SetDebugDisplay(void*, bool abTF);
NiRefObject *visDebug; // 10
UInt8 byte14; // 14
UInt8 bCollisionEnabled; // 15
UInt8 isDebugTCG; // 16
UInt8 byte17; // 17
UInt32 maybeFlags18; // 18
UInt32 unk1C; // 1C
TESTrapListener *trapListener; // 20
TESWaterListener *waterListener; // 24
BGSAcousticSpaceListener *acousticSpaceListener; // 28
void *ptr2C; // 2C
void *ptr30; // 30
void *ptr34; // 34
void *ptr38; // 38
void *ptr3C; // 3C
void *ptr40; // 40
void *ptr44; // 44
void *ptr48; // 48
void *ptr4C; // 4C
UInt32 unk50; // 50
UInt32 unk54; // 54
UInt32 unk58; // 58
UInt32 unk5C; // 5C
hkVector4 origin; // 60
hkArray<bhkEntityListener*> listeners; // 70
hkArray<void*> array7C; // 7C
float flt88; // 88
float flt8C; // 8C
UInt32 unk90; // 90
UInt32 unk94; // 94
UInt32 unk98; // 98
UInt32 unk9C; // 9C
};
static_assert(sizeof(bhkWorld) == 0xA0);
// E0
class bhkWorldM : public bhkWorld
{
public:
hkVector4 borderSize; // A0
hkVector4 worldTotalSize; // B0
hkVector4 broadPhaseSize; // C0
__forceinline static bhkWorldM *GetSingleton() {return *(bhkWorldM**)0x11CA0D8;}
};
static_assert(sizeof(bhkWorldM) == 0xD0);
// 0C
class NiCollisionObject : public NiObject
{
public:
/*8C*/virtual void Attach(NiAVObject *obj);
/*90*/virtual void Unk_24(UInt32 arg);
/*94*/virtual void Unk_25(void);
/*98*/virtual void Unk_26(UInt32 arg);
/*9C*/virtual void Unk_27(UInt32 version, UInt32 arg1);
NiNode *linkedNode; // 08
};