fork/training-mode-ce
git clone https://git.julia.blue/fork/training-mode-ce
4f5d26e
nix
1#ifndef MEX_H_DYNAMICS 2#define MEX_H_DYNAMICS 3 4#include "structs.h" 5#include "obj.h" 6#include "useful.h" 7 8/*** Structs ***/ 9 10struct DynamicBoneset 11{ 12DynamicBoneData * data ;// is stored @ 8000fdd4, comes from a nonstandard heap @ -0x52fc(r13) 13int bone_num ;// number of bones in this boneset 14float x8 ;// stored @ 80011718, 0x8 of dynamicdesc 15float xc ;// stored @ 80011720, 0xC of dynamicdesc 16float x10 ;// stored @ 80011728, 0x10 of dynamicdesc 17}; 18 19struct ftDynamics 20{ 21int dynamics_num ;// number of dynamic bonesets for this fighter 22DynamicsDesc * dynamics_desc ;// boneset data array (one for each boneset) 23int dynamics_hit_num ;// (no collide bubbles), max is 11 24DynamicsHitDesc * dynamics_hit_desc ;// dynamic hit data array (one for each dynamic hit) 25DynamicsBehave ** dynamics_behave ;// pointer to an array of dynamics behavior pointers. 26}; 27 28struct DynamicBoneData 29{ 30JOBJ * jobj ;// 0x0 31Vec4 rot ;// 0x4 quaternion 32Vec3 trans ;// 0x14 33Vec3 scale ;// 0x20 34Vec3 rot_global ;// 0x2C, copied from 0x50, 0x60, 0x70 of jobj 35float x38 ;// 0x38, initialized to 1 @ 8000ff30 36float x3c ;// 0x3c, initialized to 0 @ 8000ff34 37float x40 ;// 0x40, initialized to 0 @ 8000ff38 38float x44 ;// 0x44, initialized to 0 @ 8000ff3c 39float x48 ;// x48, initialized to 0 @ 8000ff44 40float x4c ;// x4c, THIS IS THE START OF A STRUCTURE, bunch of floats from the dynamicdesc. stored @ 80011744 41float x50 ;// 0x3c 42float x54 ;// 0x40 43float x58 ;// 0x44 44float x5c ;// x048 45float x60 ;// 0x38 46float x64 ;// 0x3c 47float x68 ;// 0x40 48float x6c ;// 0x44 49float x70 ;// x048 50float x74 ;// 0x38 51float x78 ;// 0x3c 52float x7c ;// 0x40 53float x80 ;// 0x44 54float x84 ;// x048 55float x88 ;// 0x38 56float x8c ;// 0x3c 57DynamicBoneData * next ;// 0x90 58float x94 ;// 0x44 59}; 60 61struct DynamicHit 62{ 63Vec3 offset ;// 0x1670, 0x0 64float size ;// 0x167C, 0xC 65JOBJ * bone ;// 0x1680, 0x10 66int x14 ;// 0x1684, 0x14 67Vec3 pos ;// 0x1688, 0x18 68int bone_index ;// 0x1694, 0x24 69}; 70 71struct DynamicForceDesc 72{ 73u8 x0 ;// 0x0 74u8 x1 ;// 0x1 75float x4 ;// 0x4 76Vec3 pos ;// 0x8 77float x14 ;// 0x14 78float x18 ;// 0x18 79float x1c ;// 0x1c 80float radius ;// 0x20 81float decay ;// 0x24 82int lifetime ;// 0x28, is decremented 83float x2c ;// 0x2c 84}; 85 86struct DynamicForce 87{ 88DynamicForceDesc desc ;// 0x0 89int timer ;// 0x30, counts up 90DynamicForce * next ;// 0x34 91}; 92 93static DynamicForce ** stc_dynamic_force = (void * )0x804d63b0 ;// -0x52f0 94static DynamicForce ** stc_dynamic_force_next_alloc = (void * )0x804d63ac ;// -0x52f4 95 96void Dynamics_InitBones (JOBJ * joint ,DynamicBoneset * boneset ,int bone_num ); 97void Dynamics_InitParams (void * dyn_desc_params ,DynamicBoneset * boneset ); 98void Dynamics_UpdateBoneset (DynamicBoneset * boneset ,float f1 ,DynamicHit * dynamics_hit ,int dynamics_hit_num ,int r6 ,int r7 ,int r8 ,int r9 );// 8001044c 99void Dynamics_FreeBones (DynamicBoneset * boneset ); 100void Dynamics_InitForce (); 101DynamicForce * Dynamics_CreateForce (DynamicForceDesc * ); 102void Dynamics_DecayWind (); 103#endif