SubS models (#807)

* Bring model code over

* SubS_UpdateLimb

* SubS_TurnToPoint

* SubS_TurnToPointMultiTarget

* Adjust comment

* Another comment

* Review

* options as structs

* bss

* adj -> step, SubS_TurnToPointMultiTarget -> SubS_TurnToPointStep, various comment cleanups

* Fix SubS_TurnToPointStep header comment
This commit is contained in:
Derek Hensley
2022-05-25 21:44:09 -04:00
committed by GitHub
parent af1a4b01ef
commit a6e90d144c
34 changed files with 535 additions and 316 deletions
+4 -4
View File
@@ -2424,7 +2424,7 @@ struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 switchFlag);
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx);
s32 SubS_InCsMode(GlobalContext* globalCtx);
s32 func_8013AD9C(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5);
s32 SubS_UpdateLimb(s16 newRotZ, s16 newRotY, Vec3f* pos, Vec3s* rot, s32 stepRot, s32 overrideRot);
void SubS_UpdateFlags(u16* flags, u16 setBits, u16 unsetBits);
void func_8013AF00(f32* arg0, s32 arg1, s32 arg2);
s32 func_8013B010(f32* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, f32* arg6);
@@ -2444,8 +2444,8 @@ s32 func_8013C964(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRang
void SubS_FillShadowTex(s32 startCol, s32 startRow, u8* tex, s32 size);
void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween, u8 bodyPartsNum, u8 sizes[], s8 parentBodyParts[]);
void SubS_DrawShadowTex(Actor* actor, GameState* gameState, u8* tex);
s16 func_8013D0E0(s16* arg0, s16 arg1, s16 arg2, f32 arg3, f32 arg4, f32 arg5);
s32 func_8013D2E0(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3, Vec3s* arg4, Vec3s* arg5, u16* arg6);
s16 SubS_ComputeTurnToPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f32 stepMin, f32 stepMax);
s32 SubS_TurnToPoint(Vec3f* point, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* turnTarget, Vec3s* headRot, Vec3s* torsoRot, TurnOptionsSet* options);
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
Path* SubS_GetPathByIndex(GlobalContext* globalCtx, s16 pathIndex, s16 max);
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst);
@@ -2474,7 +2474,7 @@ Actor* SubS_FindActorCustom(GlobalContext* globalCtx, Actor* actor, Actor* actor
s32 func_8013E748(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange, s32 exchangeItemId, void* data, func_8013E748_VerifyFunc verifyFunc);
s32 SubS_ActorAndPlayerFaceEachOther(GlobalContext* globalCtx, Actor* actor, void* data);
s32 func_8013E8F8(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange, s32 exhangeItemId, s16 playerYawTol, s16 actorYawTol);
s32 func_8013E950(Vec3f* arg0, Vec3f* arg1, s16 arg2, Vec3f* arg3, Vec3f* arg4, s16* arg5, s16* arg6, s16* arg7, s16* arg8, u16 arg9, u16 arg10, u16 arg11, u16 arg12);
s32 SubS_TurnToPointStep(Vec3f* worldPos, Vec3f* focusPos, s16 shapeYRot, Vec3f* yawTarget, Vec3f* pitchTarget, s16* headZRotStep, s16* headXRotStep, s16* torsoZRotStep, s16* torsoXRotStep, u16 headZRotStepMax, u16 headXRotStepMax, u16 torsoZRotStepMax, u16 torsoXRotStepMax);
// void func_8013EC10(void);
void func_8013EC44(f32 a, u8 b, u8 c, u8 d);
void func_8013ECE0(f32 xyzDistToPlayerSq, u8 arg1, u8 arg2, u8 arg3);
+14
View File
@@ -38,6 +38,20 @@ typedef s32 (*VerifyActor)(struct GlobalContext*, Actor*, Actor*, void*);
#define ACTOR_PATHING_REACHED_END \
(ACTOR_PATHING_REACHED_END_PERMANENT | ACTOR_PATHING_REACHED_END_TEMPORARY)
typedef struct TurnOptions {
/* 0x0 */ u16 rotMax; // binary angles
/* 0x2 */ u16 slowness; // larger for slower rotation, cannot be 0
/* 0x4 */ u16 rotStepMin; // degrees
/* 0x6 */ u16 rotStepMax; // degrees
} TurnOptions; // size = 0x8
typedef struct TurnOptionsSet {
/* 0x00 */ TurnOptions headRotX;
/* 0x08 */ TurnOptions headRotY;
/* 0x10 */ TurnOptions torsoRotX;
/* 0x18 */ TurnOptions torsoRotY;
} TurnOptionsSet; // size = 0x20
struct ActorPathing;
typedef void (*ActorPathingComputeFunc)(struct GlobalContext*, struct ActorPathing*);
typedef s32 (*ActorPathingUpdateFunc)(struct GlobalContext*, struct ActorPathing*);
+2 -2
View File
@@ -57,10 +57,10 @@ typedef struct EnHy {
/* 0x205 */ u8 isRightFootOnGround;
/* 0x206 */ Vec3s jointTable[ENHY_LIMB_MAX];
/* 0x266 */ Vec3s morphTable[ENHY_LIMB_MAX];
/* 0x2C6 */ Vec3s focusTarget;
/* 0x2C6 */ Vec3s turnTarget;
/* 0x2CC */ Vec3s headRot;
/* 0x2D2 */ Vec3s torsoRot;
/* 0x2D8 */ Vec3s tmpFocusTarget;
/* 0x2D8 */ Vec3s tmpTurnTarget;
/* 0x2DE */ Vec3s tmpHeadRot;
/* 0x2E4 */ Vec3s tmpTorsoRot;
/* 0x2EA */ s16 limbRotTableY[16];