fig02

fpu go die in a hole pls

Aug 10th, 2020
1,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.15 KB | None | 0 0
  1. typedef void (*EnElfActionFunc)(struct EnElf*, struct GlobalContext*);
  2. typedef void (*EnElfUnkFunc)(struct EnElf*, struct GlobalContext*);
  3.  
  4. typedef struct EnElf {
  5.     /* 0x0000 */ Actor actor;
  6.     /* 0x014C */ SkelAnime skelAnime;
  7.     /* 0x0190 */ Vec3s limbDrawTable[15];
  8.     /* 0x01EA */ Vec3s transitionDrawTable[15];
  9.     /* 0x0244 */ Color_RGBAf unk_244;
  10.     /* 0x0254 */ Color_RGBAf unk_254;
  11.     /* 0x0264 */ LightInfoPositional lightInfoPos2;
  12.     /* 0x0274 */ z_Light* light;
  13.     /* 0x0278 */ LightInfoPositional lightInfoPos3;
  14.     /* 0x0288 */ z_Light* light2;
  15.     /* 0x028C */ Vec3f unk_28C; //pos copy
  16.     /* 0x0298 */ s32 unk_298;
  17.     /* 0x029C */ char unk_29C[0x4];
  18.     /* 0x02A0 */ f32 unk_2A0;
  19.     /* 0x02A4 */ f32 unk_2A4;
  20.     /* 0x02A8 */ s16 unk_2A8;
  21.     /* 0x02AA */ s16 unk_2AA;
  22.     /* 0x02AC */ s16 unk_2AC;
  23.     /* 0x02AE */ s16 unk_2AE;
  24.     /* 0x02B0 */ s16 unk_2B0;
  25.     /* 0x02B2 */ char unk_2B2[0x2];
  26.     /* 0x02B4 */ f32 unk_2B4;
  27.     /* 0x02B8 */ f32 unk_2B8;
  28.     /* 0x02BC */ s16 unk_2BC;
  29.     /* 0x02BE */ s16 timer;
  30.     /* 0x02C0 */ s16 unk_2C0;
  31.     /* 0x02C2 */ s16 unk_2C2;
  32.     /* 0x02C4 */ u16 unk_2C4;
  33.     /* 0x02C6 */ char unk_2C6[0x1];
  34.     /* 0x02C7 */ s8 unk_2C7;
  35.     /* 0x02C8 */ EnElfUnkFunc unk_2C8; // some func pointer
  36.     /* 0x02CC */ EnElfActionFunc actionFunc;
  37. } EnElf; // size = 0x02D0
  38.  
  39. void func_80A02BD8(EnElf* this, Vec3f* attachedToPos, f32 arg2);
  40.  
  41. void func_80A02C98(EnElf* this, Vec3f* attachedToPos, f32 arg2) {
  42.     f32 x;
  43.     f32 z;
  44.     f32 xVelDir;
  45.     f32 zVelDir;
  46.     f32 xVel;
  47.     f32 zVel;
  48.  
  49.     x = ((attachedToPos->x + this->unk_28C.x) - this->actor.posRot.pos.x) * arg2;
  50.     z = ((attachedToPos->z + this->unk_28C.z) - this->actor.posRot.pos.z) * arg2;
  51.     xVelDir = (x >= 0.0f) ? 1.0f : -1.0f;
  52.     zVelDir = (z >= 0.0f) ? 1.0f : -1.0f;
  53.  
  54.     xVel = CLAMP(fabsf(x), 0.0f, 20.0f) * xVelDir;
  55.     //xVel *= xVelDir;
  56.  
  57.     zVel = CLAMP(fabsf(z), 0.0f, 20.0f) * zVelDir;
  58.     //zVel *= zVelDir;
  59.  
  60.     func_80A02BD8(this, attachedToPos, arg2);
  61.     Math_ApproxF(&this->actor.velocity.x, xVel, 1.5f);
  62.     Math_ApproxF(&this->actor.velocity.z, zVel, 1.5f);
  63.     func_8002D7EC(&this->actor);
  64. }
Advertisement
Add Comment
Please, Sign In to add comment