1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-28 07:24:04 +00:00

added VecRot class

This commit is contained in:
Blake Warner 2022-04-05 09:37:50 -04:00
parent 691d542ba8
commit f7f7f11791
53 changed files with 267 additions and 107 deletions

View File

@ -3,6 +3,7 @@ struct GameState;
struct GraphicsContext;
struct Vec3s;
struct Vec3f;
struct VecRot;
extern Mtx gMtxClear;
extern MtxF gMtxFClear;
@ -14,7 +15,9 @@ void Matrix_MtxFCopy(MtxF* dest, MtxF* src);
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest);
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx);
void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
void Matrix_MtxFToYXZRotS(MtxF* mf, VecRot* rotDest, s32 flag);
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
void Matrix_MtxFToZYXRotS(MtxF* mf, VecRot* rotDest, s32 flag);
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest);
void Matrix_Mult(MtxF* mf, u8 mode);
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest);
@ -35,4 +38,5 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode);
void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation);
void Matrix_Transpose(MtxF* mf);
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec);
void func_800D1694(f32 x, f32 y, f32 z, VecRot* vec);
void func_800D1FD4(MtxF* mf);

View File

@ -119,8 +119,8 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
void func_8002BE04(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3);
void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx);
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx);
void func_8002D7EC(Actor* actor);
void func_8002D868(Actor* actor);
void Actor_UpdatePosition(Actor* actor);
void Actor_UpdateVelocityWithGravity(Actor* actor);
void func_8002D908(Actor* actor);
void func_8002D97C(Actor* actor);
void func_8002D9A4(Actor* actor, f32 arg1);
@ -198,7 +198,7 @@ void func_800355B8(GlobalContext* globalCtx, Vec3f* pos);
u8 func_800355E4(GlobalContext* globalCtx, Collider* collider);
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, GlobalContext* globalCtx, s16 params, s32 arg8);
void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2);
void func_800359B8(Actor* actor, s16 arg1, VecRot* arg2);
u16 func_80037C30(GlobalContext* globalCtx, s16 arg1);
s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3);
s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4);

View File

@ -12,14 +12,17 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src);
void Lib_MemSet(u8* dest, size_t size, u8 val);
void Math_ApproachF(f32* pValue, f32 target, f32 fraction, const Step& step);
void Math_ApproachS(s16* pValue, s16 target, s16 scale, const Step& step);
void Math_ApproachS(Rotation* pValue, s16 target, s16 scale, const Step& step);
void Math_ApproachZeroF(f32* pValue, f32 fraction, const Step& step);
s32 Math_AsymStepToF(f32* pValue, f32 target, const Step& incrStep, const Step& decrStep);
f32 Math_CosS(s16 angle);
s32 Math_ScaledStepToS(s16* pValue, s16 target, const Step& step);
s32 Math_ScaledStepToS(Rotation* pValue, s16 target, const Step& step);
f32 Math_SinS(s16 angle);
f32 Math_SmoothStepToDegF(f32* pValue, f32 target, f32 fraction, const Step& step, const Step& minStep);
f32 Math_SmoothStepToF(f32* pValue, f32 target, f32 fraction, const Step& step, const Step& minStep);
s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& step, const Step& minStep);
s16 Math_SmoothStepToS(Rotation* pValue, s16 target, s16 scale, const Step& step, const Step& minStep);
s32 Math_StepToAngleS(s16* pValue, s16 target, const Step& step);
s32 Math_StepToF(f32* pValue, f32 target, const Step& step);
s32 Math_StepRotationToF(f32* pValue, f32 target, const Step& step);
@ -27,9 +30,11 @@ f32 Math_AngleDiffF(f32 a, f32 b);
f32 Math_NormalizeAngleF(f32 angle);
f32 Math_AngleF(Vec2f v);
s32 Math_StepToS(s16* pValue, s16 target, const Step& step);
s32 Math_StepToS(Rotation* pValue, s16 target, const Step& step);
s32 Math_StepUntilAngleS(s16* pValue, s16 limit, const Step& step);
s32 Math_StepUntilF(f32* pValue, f32 limit, const Step& step);
s32 Math_StepUntilS(s16* pValue, s16 limit, const Step& step);
s32 Math_StepUntilS(Rotation* pValue, s16 limit, const Step& step);
void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src);
void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest);
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b);

View File

@ -91,10 +91,8 @@ class Timer
operator float() const;
Timer& operator+=(const Timer f);
Timer& operator-=(const Timer f);
/*Timer operator+(const Timer f) const;
Timer operator-(const Timer f) const;
Timer operator*(const Timer f) const;
Timer operator/(const Timer f) const;*/
Timer& operator&=(u64 n);
Timer& operator|=(u64 n);
s32 operator%(s32 n) const;
Timer operator&(long n) const;
s32 operator<<(long n);

View File

@ -109,7 +109,7 @@ struct CollisionCheckInfo {
}; // size = 0x1C
struct ActorShape {
/* 0x00 */ Vec3s rot; // Current actor shape rotation
/* 0x00 */ VecRot rot; // Current actor shape rotation
/* 0x06 */ s16 face; // Used to index eyebrow/eye/mouth textures. Only used by player
/* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units
/* 0x0C */ ActorShadowFunc shadowDraw; // Shadow draw function

View File

@ -1,6 +1,7 @@
#pragma once
#include "ultra64/types.h"
#include <math.h>
#include "framerate.h"
#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z)
@ -29,6 +30,18 @@ struct Vec3i {
s32 x, y, z;
}; // size = 0x0C
struct VecRot
{
VecRot();
VecRot(const Rotation& x, const Rotation& y, const Rotation& z);
VecRot(const VecRot& vec);
VecRot(const Vec3s& vec);
VecRot(const Vec3f& vec);
operator Vec3s() const;
operator Vec3f() const;
Rotation x, y, z;
};
struct Sphere16 {
Vec3s center;
s16 radius;

View File

@ -225,6 +225,18 @@ Timer& Timer::operator-=(const Timer f)
return *this;
}
Timer& Timer::operator&=(u64 n)
{
*this = whole() & n;
return *this;
}
Timer& Timer::operator|=(u64 n)
{
*this = whole() | n;
return *this;
}
s32 Timer::operator%(s32 n) const
{
return whole() % n;

View File

@ -1,5 +1,6 @@
#define INTERNAL_SRC_CODE_SYS_MATH_C
#include "global.h"
#include "z64math.h"
#include "def/coss.h"
#include "def/sins.h"
#include "def/sys_math.h"
@ -49,3 +50,41 @@ f32 Math_SinF(f32 angle) {
f32 Math_CosF(f32 angle) {
return coss((s16)(angle * (32767.0f / M_PI))) * SHT_MINV;
}
VecRot::VecRot() : x(0), y(0), z(0)
{
}
VecRot::VecRot(const Rotation& x, const Rotation& y, const Rotation& z) : x(x), y(y), z(z)
{
}
VecRot::VecRot(const VecRot& vec) : x(vec.x), y(vec.y), z(vec.z)
{
}
VecRot::VecRot(const Vec3s& vec) : x(vec.x), y(vec.y), z(vec.z)
{
}
VecRot::VecRot(const Vec3f& vec) : x(vec.x), y(vec.y), z(vec.z)
{
}
VecRot::operator Vec3s() const
{
Vec3s vec;
vec.x = x;
vec.y = y;
vec.z = z;
return vec;
}
VecRot::operator Vec3f() const
{
Vec3f vec;
vec.x = x;
vec.y = y;
vec.z = z;
return vec;
}

View File

@ -487,7 +487,8 @@ void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation) {
}
}
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) {
template<class T>
static inline void _func_800D1694(f32 x, f32 y, f32 z, T* vec) {
MtxF* cmf = sCurrentMatrix;
f32 sp30 = Math_SinS(vec->y);
f32 sp2C = Math_CosS(vec->y);
@ -545,6 +546,16 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) {
}
}
void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
{
_func_800D1694(x, y, z, vec);
}
void func_800D1694(f32 x, f32 y, f32 z, VecRot* vec)
{
_func_800D1694(x, y, z, vec);
}
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
s32 temp;
u16* m1 = (u16*)&dest->m[0][0];
@ -763,7 +774,8 @@ void func_800D1FD4(MtxF* mf) {
* Gets the rotation the specified matrix represents, using Tait-Bryan YXZ angles.
* The flag value doesn't matter for a rotation matrix. Not 0 does extra calculation.
*/
void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
template<class T>
static inline void _Matrix_MtxFToYXZRotS(MtxF* mf, T* rotDest, s32 flag) {
f32 temp;
f32 temp2;
f32 temp3;
@ -812,11 +824,22 @@ void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
}
}
void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag)
{
_Matrix_MtxFToYXZRotS(mf, rotDest, flag);
}
void Matrix_MtxFToYXZRotS(MtxF* mf, VecRot* rotDest, s32 flag)
{
_Matrix_MtxFToYXZRotS(mf, rotDest, flag);
}
/**
* Gets the rotation the specified matrix represents, using Tait-Bryan ZYX angles.
* The flag value doesn't matter for a rotation matrix. Not 0 does extra calculation.
*/
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
template<class T>
static inline void _Matrix_MtxFToZYXRotS(MtxF* mf, T* rotDest, s32 flag) {
f32 temp;
f32 temp2;
f32 temp3;
@ -861,6 +884,16 @@ void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
}
}
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag)
{
_Matrix_MtxFToZYXRotS(mf, rotDest, flag);
}
void Matrix_MtxFToZYXRotS(MtxF* mf, VecRot* rotDest, s32 flag)
{
_Matrix_MtxFToZYXRotS(mf, rotDest, flag);
}
/*
* Rotate the matrix by `f` radians around a unit vector `vec`.
* NB: vec is assumed to be a unit vector.

View File

@ -889,7 +889,7 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) {
}
}
void func_8002D7EC(Actor* actor) {
void Actor_UpdatePosition(Actor* actor) {
const f32 speedRate = FRAMERATE_ANIM_SCALER;
actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x;
@ -897,7 +897,7 @@ void func_8002D7EC(Actor* actor) {
actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z;
}
void func_8002D868(Actor* actor) {
void Actor_UpdateVelocityWithGravity(Actor* actor) {
actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ;
actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ;
@ -908,8 +908,8 @@ void func_8002D868(Actor* actor) {
}
void Actor_MoveForward(Actor* actor) {
func_8002D868(actor);
func_8002D7EC(actor);
Actor_UpdateVelocityWithGravity(actor);
Actor_UpdatePosition(actor);
}
void func_8002D908(Actor* actor) {
@ -922,7 +922,7 @@ void func_8002D908(Actor* actor) {
void func_8002D97C(Actor* actor) {
func_8002D908(actor);
func_8002D7EC(actor);
Actor_UpdatePosition(actor);
}
void func_8002D9A4(Actor* actor, f32 arg1) {
@ -4174,7 +4174,7 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3,
return NULL;
}
void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) {
void func_800359B8(Actor* actor, s16 arg1, VecRot* arg2) {
f32 sp44;
f32 sp40;
f32 sp3C;

View File

@ -2447,7 +2447,7 @@ void ScaleRotPos_Initialize(ScaleRotPos* srp) {
/**
* Set ScaleRotPos
*/
void ScaleRotPos_SetValue(ScaleRotPos* srp, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
void ScaleRotPos_SetValue(ScaleRotPos* srp, Vec3f* scale, VecRot* rot, Vec3f* pos) {
srp->scale = *scale;
srp->rot = *rot;
srp->pos = *pos;

View File

@ -34,7 +34,8 @@ f32 Math_SinS(s16 angle) {
* Changes pValue by step (scaled by the update rate) towards target, setting it equal when the target is reached.
* Returns true when target is reached, false otherwise.
*/
s32 Math_ScaledStepToS(s16* pValue, s16 target, const Step& _step) {
template<class T>
static inline s32 _Math_ScaledStepToS(T* pValue, s16 target, const Step& _step) {
float step = _step.value();
if (step != 0) {
f32 updateScale = FRAMERATE_ANIM_SCALER;
@ -43,7 +44,7 @@ s32 Math_ScaledStepToS(s16* pValue, s16 target, const Step& _step) {
step = -step;
}
*pValue += (s16)(step * updateScale);
*pValue = *pValue + (s16)(step * updateScale);
if (((s16)(*pValue - target) * step) >= 0) {
*pValue = target;
@ -56,18 +57,29 @@ s32 Math_ScaledStepToS(s16* pValue, s16 target, const Step& _step) {
return false;
}
s32 Math_ScaledStepToS(s16* pValue, s16 target, const Step& _step)
{
return _Math_ScaledStepToS(pValue, target, _step);
}
s32 Math_ScaledStepToS(Rotation* pValue, s16 target, const Step& _step)
{
return _Math_ScaledStepToS(pValue, target, _step);
}
/**
* Changes pValue by step towards target, setting it equal when the target is reached.
* Returns true when target is reached, false otherwise.
*/
s32 Math_StepToS(s16* pValue, s16 target, const Step& _step) {
template<class T>
static inline s32 _Math_StepToS(T* pValue, s16 target, const Step& _step) {
float step = _step.value();
if (step != 0) {
if (target < *pValue) {
step = -step;
}
*pValue += step;
*pValue = *pValue + step;
if (((*pValue - target) * step) >= 0) {
*pValue = target;
@ -80,6 +92,16 @@ s32 Math_StepToS(s16* pValue, s16 target, const Step& _step) {
return false;
}
s32 Math_StepToS(s16* pValue, s16 target, const Step& _step)
{
return _Math_StepToS(pValue, target, _step);
}
s32 Math_StepToS(Rotation* pValue, s16 target, const Step& _step)
{
return _Math_StepToS(pValue, target, _step);
}
/**
* Changes pValue by step towards target, setting it equal when the target is reached.
* Returns true when target is reached, false otherwise.
@ -224,10 +246,11 @@ s32 Math_StepUntilAngleS(s16* pValue, s16 limit, const Step& step) {
* Changes pValue by step. If pvalue reaches limit, sets it equal to limit.
* Returns true when limit is reached, false otherwise.
*/
s32 Math_StepUntilS(s16* pValue, s16 limit, const Step& step) {
template<class T>
static inline s32 _Math_StepUntilS(T* pValue, s16 limit, const Step& step) {
s16 orig = *pValue;
*pValue += step.value();
*pValue = *pValue + step.value();
if (((*pValue - limit) * (orig - limit)) <= 0) {
*pValue = limit;
@ -237,6 +260,16 @@ s32 Math_StepUntilS(s16* pValue, s16 limit, const Step& step) {
return false;
}
s32 Math_StepUntilS(s16* pValue, s16 limit, const Step& step)
{
return _Math_StepUntilS(pValue, limit, step);
}
s32 Math_StepUntilS(Rotation* pValue, s16 limit, const Step& step)
{
return _Math_StepUntilS(pValue, limit, step);
}
/**
* Changes pValue by step towards target angle, setting it equal when the target is reached.
* Returns true when target is reached, false otherwise.
@ -629,7 +662,8 @@ f32 Math_SmoothStepToDegF(f32* pValue, f32 target, f32 fraction, const Step& _st
* Changes pValue by step towards target. If this step is more than 1/scale of the remaining distance, step by that
* instead, with a minimum step of minStep. Returns remaining distance to target.
*/
s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& _step, const Step& _minStep) {
template<class T>
static inline s16 _Math_SmoothStepToS(T* pValue, s16 target, s16 scale, const Step& _step, const Step& _minStep) {
float step = _step.value();
float minStep = _minStep.value();
s16 stepSize = 0;
@ -647,16 +681,16 @@ s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& _step, co
stepSize = -step;
}
*pValue += stepSize;
*pValue = *pValue + stepSize;
} else {
if (diff >= 0) {
*pValue += minStep;
*pValue = *pValue + minStep;
if ((s16)(target - *pValue) <= 0) {
*pValue = target;
}
} else {
*pValue -= minStep;
*pValue = *pValue - minStep;
if ((s16)(target - *pValue) >= 0) {
*pValue = target;
@ -668,24 +702,46 @@ s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& _step, co
return diff;
}
s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, const Step& _step, const Step& _minStep)
{
return _Math_SmoothStepToS(pValue, target, scale, _step, _minStep);
}
s16 Math_SmoothStepToS(Rotation* pValue, s16 target, s16 scale, const Step& _step, const Step& _minStep)
{
return _Math_SmoothStepToS(pValue, target, scale, _step, _minStep);
}
/**
* Changes pValue by step towards target. If step is more than 1/scale of the remaining distance, step by that instead.
*/
void Math_ApproachS(s16* pValue, s16 target, s16 scale, const Step& _maxStep) {
template<class T>
static inline void _Math_ApproachS(T* pValue, s16 target, s16 scale, const Step& _maxStep)
{
float maxStep = _maxStep.value();
s16 diff = target - *pValue;
diff /= scale;
if (diff > maxStep) {
*pValue += maxStep;
*pValue = *pValue + maxStep;
} else if (diff < -maxStep) {
*pValue -= maxStep;
*pValue = *pValue - maxStep;
} else {
*pValue += diff;
*pValue = *pValue + diff;
}
}
void Math_ApproachS(s16* pValue, s16 target, s16 scale, const Step& _maxStep)
{
_Math_ApproachS(pValue, target, scale, _maxStep);
}
void Math_ApproachS(Rotation* pValue, s16 target, s16 scale, const Step& _maxStep)
{
_Math_ApproachS(pValue, target, scale, _maxStep);
}
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) {
dst->r = src->r;
dst->g = src->g;

View File

@ -102,7 +102,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params == BGHAKAGATE_SKULL) {
if (sSkullOfTruthRotY != 0x100) {
pthis->actionFunc = BgHakaGate_FalseSkull;
} else if (ABS(thisx->shape.rot.y) < 0x4000) {
} else if (ABS((float)thisx->shape.rot.y) < 0x4000) {
if ((Rand_ZeroOne() * 3.0f) < sPuzzleState) {
pthis->vIsSkullOfTruth = true;
sSkullOfTruthRotY = thisx->shape.rot.y + 0x8000;

View File

@ -193,7 +193,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* pthis, GlobalContext* globalCtx) {
thisx->velocity.x *= 0.98f;
thisx->velocity.z *= 0.98f;
func_8002D7EC(thisx);
Actor_UpdatePosition(thisx);
thisx->shape.rot.x += thisx->world.rot.x;
thisx->shape.rot.y += thisx->world.rot.y;
thisx->shape.rot.z += thisx->world.rot.z;

View File

@ -220,7 +220,7 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* pthis, GlobalContext* globalCtx) {
pthis->collider.dim.pos.z = pthis->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs);
pthis->collider.dim.pos.y = pthis->actor.world.pos.y;
pthis->actor.world.rot.y = (projPos.z < 0.0f) ? pthis->actor.shape.rot.y : pthis->actor.shape.rot.y + 0x8000;
pthis->actor.world.rot.y = (projPos.z < 0.0f) ? (float)pthis->actor.shape.rot.y : pthis->actor.shape.rot.y + 0x8000;
}
void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) {

View File

@ -141,7 +141,7 @@ void func_80889C18(BgHidanKousi* pthis, GlobalContext* globalCtx) {
}
void func_80889C90(BgHidanKousi* pthis, GlobalContext* globalCtx) {
func_8002D7EC(&pthis->dyna.actor);
Actor_UpdatePosition(&pthis->dyna.actor);
if (D_80889E40[pthis->dyna.actor.params & 0xFF] <
Math_Vec3f_DistXYZ(&pthis->dyna.actor.home.pos, &pthis->dyna.actor.world.pos)) {
func_80889ACC(pthis);

View File

@ -110,9 +110,9 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
static Vec3s D_80897538 = { 0, -0x4000, 0 };
static VecRot D_80897538 = { 0, -0x4000, 0 };
static Vec3s D_80897540 = { 0, 0x4000, 0 };
static VecRot D_80897540 = { 0, 0x4000, 0 };
static Vec3f D_80897548[] = {
{ 0.1f, 0.1f, 0.1f },
@ -571,7 +571,7 @@ void BgJyaCobra_DrawShadow(BgJyaCobra* pthis, GlobalContext* globalCtx) {
s32 pad;
s16 params = pthis->dyna.actor.params & 3;
Vec3f sp64;
Vec3s* phi_a3;
VecRot* phi_a3;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 966);

View File

@ -954,7 +954,7 @@ void BossFd_Fly(BossFd* pthis, GlobalContext* globalCtx) {
if (pthis->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) {
func_8002D908(&pthis->actor);
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->work[BFD_LEAD_BODY_SEG]++;
if (pthis->work[BFD_LEAD_BODY_SEG] >= 100) {

View File

@ -3950,7 +3950,7 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) {
zDistFromLink = player->actor.world.pos.z - pthis->actor.world.pos.z;
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
switch (pthis->unk_1C2) {
case 0:
@ -4223,7 +4223,7 @@ void func_808E1EB4(Actor* thisx, GlobalContext* globalCtx2) {
}
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->unk_1A6++;
@ -4350,7 +4350,7 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) {
}
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->unk_1A6++;
@ -4439,7 +4439,7 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) {
pthis->unk_1C2 = 0xC;
pthis->actor.speedXZ = -30.0f;
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->unk_1F0 = dorf->unk_1FC;
numEffects = 10;
break;
@ -4456,7 +4456,7 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) {
pthis->actor.speedXZ = -30.0f;
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->unk_1F0.x = Rand_CenteredFloat(700.0f) + dorf->unk_1FC.x;
pthis->unk_1F0.y = Rand_CenteredFloat(200.0f) + dorf->unk_1FC.y;

View File

@ -841,7 +841,7 @@ void BossGanondrof_Charge(BossGanondrof* pthis, GlobalContext* globalCtx) {
}
func_8002D908(thisx);
func_8002D7EC(thisx);
Actor_UpdatePosition(thisx);
Math_ApproachF(&thisx->speedXZ, 10.0f, 1.0f, 0.5f);
if ((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f))) {
pthis->work[GND_ACTION_STATE] = CHARGE_FINISH;

View File

@ -2635,7 +2635,7 @@ void BossMo_Core(BossMo* pthis, GlobalContext* globalCtx) {
pthis->actor.world.pos.y += pthis->actor.velocity.y;
pthis->actor.velocity.y -= 1.0f;
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
temp = (pthis->actor.world.pos.y < -200.0f) ? 5 : 1;
pthis->actor.world.pos.y -= 20.0f;
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 50.0f, 20.0f, 100.0f, temp);

View File

@ -652,7 +652,7 @@ void BossTw_TurnToPlayer(BossTw* pthis, GlobalContext* globalCtx) {
Math_ApproachS(&pthis->actor.shape.rot.x, 0, 5, pthis->rotateSpeed);
Math_ApproachF(&pthis->rotateSpeed, 4096.0f, 1.0f, 200.0f);
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if (pthis->timers[0] == 0) {
if ((otherTw->actionFunc != BossTw_ShootBeam) && pthis->work[CAN_SHOOT]) {
pthis->work[CAN_SHOOT] = false;
@ -721,7 +721,7 @@ void BossTw_FlyTo(BossTw* pthis, GlobalContext* globalCtx) {
Math_ApproachF(&pthis->rotateSpeed, 4096.0f, 1.0f, 100.0f);
Math_ApproachF(&pthis->actor.speedXZ, 10.0f, 1.0f, 1.0f);
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if ((pthis->timers[0] == 0) || (xzDist < 70.0f)) {
BossTw_SetupTurnToPlayer(pthis, globalCtx);
@ -2388,7 +2388,7 @@ void BossTw_DeathBall(BossTw* pthis, GlobalContext* globalCtx) {
pthis->rotateSpeed);
Math_ApproachS(&pthis->actor.world.rot.y, yaw, 5, pthis->rotateSpeed);
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
void BossTw_TwinrovaSetupDeathCS(BossTw* pthis, GlobalContext* globalCtx) {
@ -3937,7 +3937,7 @@ void BossTw_BlastFire(BossTw* pthis, GlobalContext* globalCtx) {
pthis->blastActive = true;
if (pthis->timers[0] == 0) {
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_TWINROBA_SHOOT_FIRE & ~SFX_FLAG);
} else {
Vec3f velocity;
@ -4127,7 +4127,7 @@ void BossTw_BlastIce(BossTw* pthis, GlobalContext* globalCtx) {
if (pthis->timers[0] == 0) {
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG);
} else {
Vec3f velocity;

View File

@ -233,7 +233,7 @@ void DoorKiller_FallAsRubble(DoorKiller* pthis, GlobalContext* globalCtx) {
} else {
Actor_Kill(&pthis->actor);
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
s32 DoorKiller_IsHit(Actor* thisx, GlobalContext* globalCtx) {

View File

@ -449,7 +449,7 @@ void EnAnubice_Update(Actor* thisx, GlobalContext* globalCtx) {
pthis->actionFunc(pthis, globalCtx);
pthis->actor.velocity.y += pthis->actor.gravity;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if (!pthis->isLinkOutOfRange) {
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 5.0f, 5.0f, 10.0f, 0x1D);

View File

@ -194,7 +194,7 @@ void EnAnubiceFire_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&pthis->actor, pthis->scale);
pthis->actionFunc(pthis, globalCtx);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->unk_160[0] = pthis->actor.world.pos;
if (1) {}

View File

@ -414,7 +414,7 @@ void EnBubble_Regrow(EnBubble* pthis, GlobalContext* globalCtx) {
void EnBubble_Update(Actor* thisx, GlobalContext* globalCtx) {
EnBubble* pthis = (EnBubble*)thisx;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 16.0f, 16.0f, 0.0f, 7);
pthis->actionFunc(pthis, globalCtx);
Actor_SetFocus(&pthis->actor, pthis->actor.shape.yOffset);

View File

@ -258,7 +258,7 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
pthis->actor.speedXZ = 35.0f;
func_8002D908(&pthis->actor);
for (j = 0; j <= 0; j++) {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
pthis->actor.scale.x = 0.4f;
pthis->actor.scale.y = 0.4f;
@ -517,7 +517,7 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) {
pthis->crashingTimer--;
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_SetFocus(&pthis->actor, 0.0f);
@ -562,7 +562,7 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) {
break;
case CLEAR_TAG_STATE_LASER:
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
// Check if the laser has hit a target.
if (pthis->collider.base.atFlags & AT_HIT) {

View File

@ -443,7 +443,7 @@ void func_809F74C4(EnDodojr* pthis, GlobalContext* globalCtx) {
}
void func_809F758C(EnDodojr* pthis, GlobalContext* globalCtx) {
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
func_809F6730(pthis, globalCtx, &pthis->actor.world.pos);
if (DECR(pthis->timer4) == 0) {
@ -500,7 +500,7 @@ void func_809F773C(EnDodojr* pthis, GlobalContext* globalCtx) {
void func_809F77AC(EnDodojr* pthis, GlobalContext* globalCtx) {
pthis->rootScale = 1.2f;
pthis->rootScale *= ((f32)pthis->actor.colorFilterTimer / 8);
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
if (func_809F68B0(pthis, globalCtx) != 0) {
pthis->timer3 = 60;
@ -515,7 +515,7 @@ void func_809F784C(EnDodojr* pthis, GlobalContext* globalCtx) {
}
void func_809F786C(EnDodojr* pthis, GlobalContext* globalCtx) {
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
if (func_809F68B0(pthis, globalCtx) != 0) {
func_809F6AC4(pthis);
@ -548,7 +548,7 @@ void func_809F78EC(EnDodojr* pthis, GlobalContext* globalCtx) {
void func_809F799C(EnDodojr* pthis, GlobalContext* globalCtx) {
pthis->actor.flags |= ACTOR_FLAG_24;
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
if (func_809F68B0(pthis, globalCtx) != 0) {
func_809F6994(pthis);
@ -572,7 +572,7 @@ void func_809F7A00(EnDodojr* pthis, GlobalContext* globalCtx) {
}
void func_809F7AB8(EnDodojr* pthis, GlobalContext* globalCtx) {
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
Math_SmoothStepToS(&pthis->actor.shape.rot.y, 0, 4, 1000, 10);
pthis->actor.world.rot.x = pthis->actor.shape.rot.x;

View File

@ -580,7 +580,7 @@ void EnDu_Update(Actor* thisx, GlobalContext* globalCtx) {
pthis->actor.world.pos.y += pthis->actor.velocity.y;
pthis->actor.world.pos.z += pthis->actor.velocity.z;
} else {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 0.0f, 0.0f, 0.0f, 4);

View File

@ -529,14 +529,14 @@ void func_80A02C98(EnElf* pthis, Vec3f* targetPos, f32 arg2) {
func_80A02BD8(pthis, targetPos, arg2);
Math_StepToF(&pthis->actor.velocity.x, xVelTarget, 1.5f);
Math_StepToF(&pthis->actor.velocity.z, zVelTarget, 1.5f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
void func_80A02E30(EnElf* pthis, Vec3f* targetPos) {
func_80A02BD8(pthis, targetPos, 0.2f);
pthis->actor.velocity.x = (targetPos->x + pthis->unk_28C.x) - pthis->actor.world.pos.x;
pthis->actor.velocity.z = (targetPos->z + pthis->unk_28C.z) - pthis->actor.world.pos.z;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.world.pos.x = targetPos->x + pthis->unk_28C.x;
pthis->actor.world.pos.z = targetPos->z + pthis->unk_28C.z;
}
@ -544,7 +544,7 @@ void func_80A02E30(EnElf* pthis, Vec3f* targetPos) {
void func_80A02EC0(EnElf* pthis, Vec3f* targetPos) {
func_80A02BD8(pthis, targetPos, 0.2f);
pthis->actor.velocity.x = pthis->actor.velocity.z = 0.0f;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.world.pos.x = targetPos->x + pthis->unk_28C.x;
pthis->actor.world.pos.z = targetPos->z + pthis->unk_28C.z;
}
@ -619,7 +619,7 @@ void func_80A03148(EnElf* pthis, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) {
Math_StepToF(&pthis->actor.velocity.x, xVelTarget, 5.0f);
Math_StepToF(&pthis->actor.velocity.z, zVelTarget, 5.0f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
void func_80A0329C(EnElf* pthis, GlobalContext* globalCtx) {

View File

@ -204,13 +204,13 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* pthis, GlobalContext* globalCtx) {
if (pthis->actor.speedXZ < 0.1f) {
pthis->actor.speedXZ = 5.0f;
}
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
}
}
void EnFdFire_Disappear(EnFdFire* pthis, GlobalContext* globalCtx) {
Math_SmoothStepToF(&pthis->actor.speedXZ, 0.0f, 0.6f, 9.0f, 0.0f);
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
Math_SmoothStepToF(&pthis->scale, 0.0f, 0.3f, 0.1f, 0.0f);
pthis->actor.shape.shadowScale = 20.0f;
pthis->actor.shape.shadowScale *= (pthis->scale / 3.0f);
@ -229,7 +229,7 @@ void EnFdFire_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actionFunc(pthis, globalCtx);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 12.0f, 10.0f, 0.0f, 5);

View File

@ -442,7 +442,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* pthis, GlobalContext* globalCtx) {
dyL = player->actor.world.pos.y + 40.0f - pthis->actor.world.pos.y;
dzL = player->actor.world.pos.z - pthis->actor.world.pos.z;
func_8002D908(&pthis->actor);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if (pthis->work[FHGFIRE_VARIANCE_TIMER] & 1) {
Actor_SetScale(&pthis->actor, 6.0f);
} else {

View File

@ -301,7 +301,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* pthis, GlobalContext* globalCtx) {
}
break;
case GSWITCH_LEFT:
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if ((pthis->actor.velocity.x < 0.0f) && (pthis->actor.world.pos.x < pthis->targetPos.x)) {
gallery = ((EnSyatekiItm*)pthis->actor.parent);
if (gallery->actor.update != NULL) {
@ -311,7 +311,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* pthis, GlobalContext* globalCtx) {
}
break;
case GSWITCH_RIGHT:
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if (pthis->actor.world.pos.x > pthis->targetPos.x) {
gallery = ((EnSyatekiItm*)pthis->actor.parent);
if (gallery->actor.update != NULL) {

View File

@ -327,7 +327,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* pthis, GlobalContext* globalCtx) {
Vec3s* nextPointPos;
Math_StepToF(&pthis->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f);
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
path = &globalCtx->setupPathList[pthis->actor.params & 0xFF];
nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + pthis->nextWaypoint;
result = true;

View File

@ -432,12 +432,12 @@ void EnHonotrap_FlameChase(EnHonotrap* pthis, GlobalContext* globalCtx) {
Math_ScaledStepToS(&pthis->actor.world.rot.y, pthis->actor.yawTowardsPlayer, 0x300);
Math_StepToF(&pthis->actor.speedXZ, 3.0f, 0.1f);
pthis->actor.gravity = (-pthis->actor.yDistToPlayer < 10.0f) ? 0.08f : -0.08f;
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
if (pthis->actor.velocity.y > 1.0f) {
pthis->actor.velocity.y = 1.0f;
}
pthis->actor.velocity.y *= 0.95f;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 7.0f, 10.0f, 0.0f, 0x1D);
if (pthis->collider.cyl.base.atFlags & AT_BOUNCED) {
Player* player = GET_PLAYER(globalCtx);

View File

@ -414,7 +414,7 @@ void EnIshi_LiftedUp(EnIshi* pthis, GlobalContext* globalCtx) {
EnIshi_SetupFly(pthis);
EnIshi_Fall(pthis);
func_80A7ED94(&pthis->actor.velocity, D_80A7FA28[pthis->actor.params & 1]);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 7.5f, 35.0f, 0.0f, 0xC5);
}
}
@ -481,7 +481,7 @@ void EnIshi_Fly(EnIshi* pthis, GlobalContext* globalCtx) {
Math_StepToF(&pthis->actor.shape.yOffset, 0.0f, 2.0f);
EnIshi_Fall(pthis);
func_80A7ED94(&pthis->actor.velocity, D_80A7FA28[type]);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.shape.rot.x += sRotSpeedX;
pthis->actor.shape.rot.y += sRotSpeedY;
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 7.5f, 35.0f, 0.0f, 0xC5);

View File

@ -368,7 +368,7 @@ void EnKusa_LiftedUp(EnKusa* pthis, GlobalContext* globalCtx) {
pthis->actor.gravity = -0.1f;
EnKusa_UpdateVelY(pthis);
EnKusa_RandScaleVecToZero(&pthis->actor.velocity, 0.005f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 7.5f, 35.0f, 0.0f, 0xC5);
pthis->actor.gravity = -3.2f;
}
@ -428,7 +428,7 @@ void EnKusa_Fall(EnKusa* pthis, GlobalContext* globalCtx) {
pthis->actor.shape.rot.x += rotSpeedX;
pthis->actor.shape.rot.y += rotSpeedY;
EnKusa_RandScaleVecToZero(&pthis->actor.velocity, 0.05f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 7.5f, 35.0f, 0.0f, 0xC5);
Collider_UpdateCylinder(&pthis->actor, &pthis->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &pthis->collider.base);

View File

@ -1059,7 +1059,7 @@ void func_80AECEB4(EnRu1* pthis, GlobalContext* globalCtx) {
}
s32 func_80AECF6C(EnRu1* pthis, GlobalContext* globalCtx) {
s16* shapeRotY;
Rotation* shapeRotY;
Player* player = GET_PLAYER(globalCtx);
Player* otherPlayer;
s16 temp_f16;
@ -1487,7 +1487,7 @@ void func_80AEE050(EnRu1* pthis) {
}
pthis->actor.velocity.x = Math_SinS(pthis->actor.world.rot.y) * pthis->actor.speedXZ;
pthis->actor.velocity.z = Math_CosS(pthis->actor.world.rot.y) * pthis->actor.speedXZ;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
} else {
if (pthis->unk_350 == 1) {

View File

@ -723,7 +723,7 @@ void EnSa_Update(Actor* thisx, GlobalContext* globalCtx) {
pthis->actor.world.pos.y += pthis->actor.velocity.y;
pthis->actor.world.pos.z += pthis->actor.velocity.z;
} else {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
if (globalCtx->sceneNum != SCENE_SPOT05) {

View File

@ -826,7 +826,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) {
EnSsh_Damaged(pthis);
} else {
SkelAnime_Update(&pthis->skelAnime);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 0.0f, 0.0f, 0.0f, 4);
pthis->actionFunc(pthis, globalCtx);
}

View File

@ -945,7 +945,7 @@ void EnSt_ReturnToCeiling(EnSt* pthis, GlobalContext* globalCtx) {
*/
void EnSt_BounceAround(EnSt* pthis, GlobalContext* globalCtx) {
pthis->actor.colorFilterTimer = pthis->deathTimer.whole();
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
pthis->actor.world.rot.x += 0x800 * FRAMERATE_SCALER;
pthis->actor.world.rot.z -= 0x800 * FRAMERATE_SCALER;
pthis->actor.shape.rot = pthis->actor.world.rot;
@ -983,7 +983,7 @@ void EnSt_FinishBouncing(EnSt* pthis, GlobalContext* globalCtx) {
pthis->actor.shape.rot = pthis->actor.world.rot;
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
pthis->groundBounces = 2;
EnSt_IsDoneBouncing(pthis, globalCtx);
}
@ -1027,7 +1027,7 @@ void EnSt_Update(Actor* pthisx, GlobalContext* globalCtx) {
}
if (pthis->swayTimer == 0 && pthis->stunTimer == 0) {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 0.0f, 0.0f, 0.0f, 4);

View File

@ -638,7 +638,7 @@ void EnTite_Recoil(EnTite* pthis, GlobalContext* globalCtx) {
pthis->actor.world.rot.y = pthis->actor.shape.rot.y;
pthis->collider.base.atFlags &= ~AT_HIT;
if ((pthis->actor.xzDistToPlayer > 300.0f) && (pthis->actor.yDistToPlayer > 80.0f) &&
(ABS(pthis->actor.shape.rot.x) < 4000) && (ABS(pthis->actor.shape.rot.z) < 4000) &&
(ABS((float)pthis->actor.shape.rot.x) < 4000) && (ABS((float)pthis->actor.shape.rot.z) < 4000) &&
((pthis->actor.bgCheckFlags & 1) ||
((pthis->actor.params == TEKTITE_BLUE) && (pthis->actor.bgCheckFlags & 0x20)))) {
EnTite_SetupIdle(pthis);
@ -710,7 +710,7 @@ void EnTite_Stunned(EnTite* pthis, GlobalContext* globalCtx) {
} else if (pthis->flipState == TEKTITE_FLIPPED) {
EnTite_SetupFlipUpright(pthis);
} else if (((pthis->actor.xzDistToPlayer > 300.0f) && (pthis->actor.yDistToPlayer > 80.0f) &&
(ABS(pthis->actor.shape.rot.x) < 4000) && (ABS(pthis->actor.shape.rot.z) < 4000)) &&
(ABS((float)pthis->actor.shape.rot.x) < 4000) && (ABS((float)pthis->actor.shape.rot.z) < 4000)) &&
((pthis->actor.bgCheckFlags & 1) ||
((pthis->actor.params == TEKTITE_BLUE) && (pthis->actor.bgCheckFlags & 0x20)))) {
EnTite_SetupIdle(pthis);

View File

@ -357,7 +357,7 @@ void EnTp_Fragment_SetupFade(EnTp* pthis) {
}
void EnTp_Fragment_Fade(EnTp* pthis, GlobalContext* globalCtx) {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->alpha -= 20;
if (pthis->alpha < 20) {

View File

@ -504,7 +504,7 @@ void func_80B24038(EnTr* pthis, GlobalContext* globalCtx, s32 actionIndex) {
Math_StepToF(&pthis->actor.velocity.x, endPos.x, 1.0f);
Math_StepToF(&pthis->actor.velocity.y, endPos.y, 1.0f);
Math_StepToF(&pthis->actor.velocity.z, endPos.z, 1.0f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
void EnTr_UpdateRotation(EnTr* pthis, GlobalContext* globalCtx, s32 actionIndex) {

View File

@ -192,7 +192,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx2) {
pthis->actor.shape.rot.y += (s16)pthis->yRotVel;
pthis->actor.velocity.y += -1.0f;
pthis->actor.gravity = -1.0f;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
if (pthis->actor.params >= 200) {
EnVbBall_UpdateBones(pthis, globalCtx);
} else {

View File

@ -393,7 +393,7 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) {
pthis->unk_14C++;
Math_ApproachF(&pthis->actor.velocity.x, 0.0f, 1.0f, 5 * 0.01f);
Math_ApproachF(&pthis->actor.velocity.z, 0.0f, 1.0f, 5 * 0.01f);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.shape.rot.z = Math_SinS(3000 * pthis->unk_14C) * 0x4000;
pthis->unk_14E[0]--;

View File

@ -1994,7 +1994,7 @@ void func_80B57D60(EnZl3* pthis, GlobalContext* globalCtx) {
s32 func_80B57D80(EnZl3* pthis, GlobalContext* globalCtx) {
s32 pad;
s16* sp32 = &pthis->actor.shape.rot.y;
auto sp32 = &pthis->actor.shape.rot.y;
struct_80034A14_arg1* unk_3F8 = &pthis->unk_3F8;
Player* player = GET_PLAYER(globalCtx);
s32 unk_314 = pthis->unk_314;

View File

@ -4007,7 +4007,7 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
func_8002D908(&pthis->actor);
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.world.pos.y += (pthis->unk_184 * 1.5f);

View File

@ -87,7 +87,7 @@ void ItemOcarina_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ItemOcarina_Fly(ItemOcarina* pthis, GlobalContext* globalCtx) {
Vec3f ripplePos;
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.shape.rot.x += pthis->spinRotOffset * 2;
pthis->actor.shape.rot.y += pthis->spinRotOffset * 3;
@ -138,7 +138,7 @@ void ItemOcarina_GetThrown(ItemOcarina* pthis, GlobalContext* globalCtx) {
}
void func_80B864EC(ItemOcarina* pthis, GlobalContext* globalCtx) {
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
pthis->actor.shape.rot.x += pthis->spinRotOffset * 2;
pthis->actor.shape.rot.y += pthis->spinRotOffset * 3;

View File

@ -210,7 +210,7 @@ void func_80B86F68(ItemShield* pthis, GlobalContext* globalCtx) {
pthis->actor.shape.rot.y = Math_Atan2S(-shield->zz, -shield->xz);
pthis->actor.shape.rot.x = Math_Atan2S(-shield->yz, sqrtf(shield->zz * shield->zz + shield->xz * shield->xz));
if (ABS(pthis->actor.shape.rot.x) > 0x4000) {
if (ABS((float)pthis->actor.shape.rot.x) > 0x4000) {
pthis->unk_19C |= 1;
}

View File

@ -247,7 +247,7 @@ void ObjKibako_Held(ObjKibako* pthis, GlobalContext* globalCtx) {
} else {
ObjKibako_SetupThrown(pthis);
ObjKibako_ApplyGravity(pthis);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
}
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 19.0f, 20.0f, 0.0f, 5);
}
@ -276,7 +276,7 @@ void ObjKibako_Thrown(ObjKibako* pthis, GlobalContext* globalCtx) {
Actor_Kill(&pthis->actor);
} else {
ObjKibako_ApplyGravity(pthis);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 19.0f, 20.0f, 0.0f, 5);
Collider_UpdateCylinder(&pthis->actor, &pthis->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &pthis->collider.base);

View File

@ -298,7 +298,7 @@ void ObjTsubo_LiftedUp(ObjTsubo* pthis, GlobalContext* globalCtx) {
pthis->actor.room = globalCtx->roomCtx.curRoom.num;
ObjTsubo_SetupThrown(pthis);
ObjTsubo_ApplyGravity(pthis);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Actor_UpdateBgCheckInfo(globalCtx, &pthis->actor, 5.0f, 15.0f, 0.0f, 0x85);
}
}
@ -329,7 +329,7 @@ void ObjTsubo_Thrown(ObjTsubo* pthis, GlobalContext* globalCtx) {
Actor_Kill(&pthis->actor);
} else {
ObjTsubo_ApplyGravity(pthis);
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
Math_StepToS(&D_80BA1B54, D_80BA1B50, 0x64);
Math_StepToS(&D_80BA1B5C, D_80BA1B58, 0x64);
pthis->actor.shape.rot.x += D_80BA1B54;

View File

@ -2543,7 +2543,7 @@ s32 func_808359FC(Player* pthis, GlobalContext* globalCtx) {
} else if (LinkAnimation_OnFrame(&pthis->skelAnime2, 6.0f)) {
f32 posX = (Math_SinS(pthis->actor.shape.rot.y) * 10.0f) + pthis->actor.world.pos.x;
f32 posZ = (Math_CosS(pthis->actor.shape.rot.y) * 10.0f) + pthis->actor.world.pos.z;
s32 yaw = (pthis->unk_664 != NULL) ? pthis->actor.shape.rot.y + 14000 : pthis->actor.shape.rot.y;
s32 yaw = (pthis->unk_664 != NULL) ? pthis->actor.shape.rot.y + 14000 : (float)pthis->actor.shape.rot.y;
EnBoom* boomerang =
(EnBoom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOOM, posX, pthis->actor.world.pos.y + 30.0f,
posZ, pthis->actor.focus.rot.x, yaw, 0, 0);
@ -10082,7 +10082,7 @@ void Player_UpdateCommon(Player* pthis, GlobalContext* globalCtx, Input* input)
pthis->actor.world.rot.y = pthis->currentYaw;
}
func_8002D868(&pthis->actor);
Actor_UpdateVelocityWithGravity(&pthis->actor);
if ((pthis->windSpeed != 0.0f) && !Player_InCsMode(globalCtx) && !(pthis->stateFlags1 & 0x206000) &&
(func_80845668 != pthis->playerUpdateFunct) && (func_808507F4 != pthis->playerUpdateFunct)) {
@ -10090,7 +10090,7 @@ void Player_UpdateCommon(Player* pthis, GlobalContext* globalCtx, Input* input)
pthis->actor.velocity.z += pthis->windSpeed * Math_CosS(pthis->windDirection);
}
func_8002D7EC(&pthis->actor);
Actor_UpdatePosition(&pthis->actor);
func_80847BA0(globalCtx, pthis);
} else {
D_808535E4 = 0;