Quake & Distortion Docs (Again) + Math Cleanup (Camera Prep) (#1129)

* more quake docs

* more docs

* more distortion docs

* math cleanup

* fix header

* cleanup

* only partial PR review

* PR Suggestions

* fix master merge

* reverb angle change macros

* more revert

* fix enum
This commit is contained in:
engineer124
2023-05-18 10:29:50 -04:00
committed by GitHub
parent 83ac58d739
commit 180227e7bb
62 changed files with 811 additions and 729 deletions
+10 -10
View File
@@ -739,9 +739,9 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16
s32 Actor_IsTargeted(PlayState* play, Actor* actor);
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor);
void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play);
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown);
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed);
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown);
void Actor_RequestQuake(PlayState* play, s16 y, s16 duration);
void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed);
void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 bufFlag, u16 duration);
Hilite* func_800BCBF4(Vec3f* arg0, PlayState* play);
@@ -833,7 +833,7 @@ s16 Camera_ClearFlags(Camera* camera, s16 flags);
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s16 timer3);
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
// UNK_TYPE4 func_800E01AC(void);
Vec3f* Camera_GetQuakeOffset(Vec3f* dst, Camera* camera);
Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera);
// void func_800E01DC(s32 param_1, u32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
// UNK_TYPE4 func_800E0228(void);
void func_800E0238(Camera* camera);
@@ -1462,17 +1462,17 @@ f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph);
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph);
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec);
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec);
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec);
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b);
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphAddToVec3f(Vec3f* dest, Vec3f* a, VecSph* sph);
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b);
void OLib_DbCameraVec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
void OLib_DbCameraVec3fSum(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
void OLib_Vec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
void OLib_Vec3fAdd(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
Gfx* Gfx_DrawTexRectRGBA16(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy);
Gfx* Gfx_DrawTexRectIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy);
+2 -2
View File
@@ -532,8 +532,8 @@ typedef enum {
#define ACTOR_FLAG_400 (1 << 10)
//
#define ACTOR_FLAG_800 (1 << 11)
//
#define ACTOR_FLAG_1000 (1 << 12)
// Actor will not shake when a quake occurs
#define ACTOR_FLAG_IGNORE_QUAKE (1 << 12)
//
#define ACTOR_FLAG_2000 (1 << 13)
//
+7 -7
View File
@@ -374,7 +374,7 @@ typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f norm;
/* 0x18 */ CollisionPoly* poly;
/* 0x1C */ VecSph sphNorm;
/* 0x1C */ VecGeo geoNorm;
/* 0x24 */ s32 bgId;
} CameraCollision; // size = 0x28
@@ -1244,8 +1244,8 @@ typedef struct {
typedef struct {
/* 0x00 */ Vec3f unk_00;
/* 0x0C */ VecSph unk_0C;
/* 0x14 */ VecSph unk_14;
/* 0x0C */ VecGeo unk_0C;
/* 0x14 */ VecGeo unk_14;
/* 0x1C */ s16 unk_1C;
} Demo1ReadWriteData; // size = 0x20
@@ -1319,7 +1319,7 @@ typedef struct {
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ VecSph unk_18;
/* 0x18 */ VecGeo unk_18;
/* 0x20 */ s16 unk_20;
/* 0x22 */ s16 timer;
} Demo4ReadWriteData; // size = 0x24
@@ -1345,7 +1345,7 @@ typedef struct {
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ VecSph unk_1C;
/* 0x1C */ VecGeo unk_1C;
/* 0x24 */ s16 unk_24;
/* 0x26 */ s16 timer;
} Demo5ReadWriteData; // size = 0x28
@@ -1367,8 +1367,8 @@ typedef struct {
typedef struct {
/* 0x00 */ f32 unk_00;
/* 0x04 */ VecSph subAtToEye;
/* 0x0C */ VecSph atToEye;
/* 0x04 */ VecGeo subAtToEye;
/* 0x0C */ VecGeo atToEye;
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ s16 unk_18;
+25 -5
View File
@@ -87,12 +87,32 @@ typedef struct {
/* 0x0C */ Vec3f b;
} LineSegment; // size = 0x18
// Defines a point in the spherical coordinate system
typedef struct {
/* 0x0 */ f32 r; // radius
/* 0x4 */ s16 pitch; // polar (zenith) angle
/* 0x6 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x8
/* 0x0 */ f32 r; // radius
/* 0x4 */ s16 pitch; // depends on coordinate system. See below.
/* 0x6 */ s16 yaw; // azimuthal angle
} VecSphGeo; // size = 0x8
// Defines a point in the spherical coordinate system.
// Pitch is 0 along the positive y-axis (up)
typedef VecSphGeo VecSph;
// Defines a point in the geographic coordinate system.
// Pitch is 0 along the xz-plane (horizon)
typedef VecSphGeo VecGeo;
// To be used with OLib_Vec3fAdd()
typedef enum {
/* 0 */ OLIB_ADD_COPY, // Copy `b` to dest
/* 1 */ OLIB_ADD_OFFSET, // Add `a` and `b` to dest, and also add the yaw of `a` to the dest
/* 2 */ OLIB_ADD, // Add `a` and `b` to dest
} OlibVec3fAdd;
typedef enum {
/* 0 */ OLIB_DIFF_COPY, // Copy `b` to dest
/* 1 */ OLIB_DIFF_OFFSET, // Sub `a` and `b` to dest, and also subs the yaw of `a` to the dest
/* 2 */ OLIB_DIFF, // Sub `a` and `b` to dest
} OlibVec3fDiff;
#define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t)))
#define F32_LERP(v0, v1, t) ((1.0f - (t)) * (f32)(v0) + (t) * (f32)(v1))
+43 -47
View File
@@ -1,68 +1,64 @@
#ifndef Z64QUAKE_H
#define Z64QUAKE_H
#include "z64camera.h"
#include "z64math.h"
struct PlayState;
struct Camera;
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset;
/* 0x1A */ s16 zoom;
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used
} QuakeCamCalc; // size = 0x20
#define QUAKE_SPEED (1 << 0)
#define QUAKE_VERTICAL_MAG (1 << 1)
#define QUAKE_HORIZONTAL_MAG (1 << 2)
#define QUAKE_ZOOM (1 << 3)
#define QUAKE_ROLL_OFFSET (1 << 4)
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
#define QUAKE_COUNTDOWN (1 << 8)
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
/* 0x18 */ s16 upRollOffset;
/* 0x1A */ s16 fovOffset;
/* 0x1C */ f32 maxOffset; // Set to scaled max data of struct (mag for Vec3f), never used
} ShakeInfo; // size = 0x20
typedef enum {
/* 1 */ QUAKE_TYPE_1 = 1,
/* 2 */ QUAKE_TYPE_2,
/* 3 */ QUAKE_TYPE_3,
/* 4 */ QUAKE_TYPE_4,
/* 5 */ QUAKE_TYPE_5,
/* 6 */ QUAKE_TYPE_6
/* 0 */ QUAKE_TYPE_NONE,
/* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations
/* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations
/* 3 */ QUAKE_TYPE_3, // Periodic, decaying
/* 4 */ QUAKE_TYPE_4, // Aperiodic, decaying, random X perturbations
/* 5 */ QUAKE_TYPE_5, // Periodic, sustaining
/* 6 */ QUAKE_TYPE_6 // See below
} QuakeType;
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value);
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed);
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown);
s16 Quake_GetCountdown(s16 quakeIndex);
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset);
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset);
s16 Quake_Add(Camera* camera, u32 type);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
u32 Quake_Remove(s16 index);
s32 Quake_NumActiveQuakes(void);
s16 Quake_Request(Camera* camera, u32 type);
u32 Quake_SetSpeed(s16 index, s16 speed);
u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll);
u32 Quake_SetDuration(s16 index, s16 duration);
u32 Quake_SetOrientation(s16 index, s16 isRelativeToScreen, Vec3s orientation);
s16 Quake_GetTimeLeft(s16 index);
s32 Quake_GetNumActiveQuakes(void);
u32 Quake_RemoveRequest(s16 index);
void Quake_Init(void);
s16 Quake_Update(Camera* camera, ShakeInfo* camShake);
#define DISTORTION_TYPE_0 (1 << 0)
#define DISTORTION_TYPE_NON_ZORA_SWIMMING (1 << 2)
#define DISTORTION_TYPE_ZORA_SWIMMING (1 << 3)
#define DISTORTION_TYPE_UNDERWATER_ENTRY (1 << 4)
#define DISTORTION_TYPE_5 (1 << 5)
#define DISTORTION_TYPE_6 (1 << 6)
#define DISTORTION_TYPE_7 (1 << 7)
#define DISTORTION_TYPE_8 (1 << 8)
#define DISTORTION_TYPE_9 (1 << 9)
#define DISTORTION_TYPE_A (1 << 10)
#define DISTORTION_TYPE_B (1 << 11)
#define DISTORTION_TYPE_HOT_ROOM (1 << 0) // Hot Room
#define DISTORTION_TYPE_NON_ZORA_SWIMMING (1 << 2) // Non-Zora swimming
#define DISTORTION_TYPE_ZORA_SWIMMING (1 << 3) // Zora swimming, also used for boss warp pad part 1
void Distortion_SetCountdown(s16 countdown);
s16 Distortion_GetCountdown(void);
#define DISTORTION_TYPE_UNDERWATER_ENTRY (1 << 4) // Entering water, also used for boss warp pad part 2
#define DISTORTION_TYPE_SONG_OF_TIME (1 << 5) // Song of Time effects
#define DISTORTION_TYPE_ZORA_KICK (1 << 6) // PLAYER_MWA_ZORA_PUNCH_KICK
#define DISTORTION_TYPE_UNK_ATTACK (1 << 7) // Impossible to achieve, inferred to be another `PLAYER_MWA_`,
#define DISTORTION_TYPE_GORON_BUTT (1 << 8) // PLAYER_MWA_GORON_PUNCH_BUTT
#define DISTORTION_TYPE_MASK_TRANSFORM_1 (1 << 9) // Mask transformation part 1
#define DISTORTION_TYPE_BOSS_WARP (1 << 10) // Boss warp pad part 3
#define DISTORTION_TYPE_MASK_TRANSFORM_2 (1 << 11) // Mask transformation part 2
void Distortion_Request(s32 type);
void Distortion_SetDuration(s16 duration);
s16 Distortion_GetTimeLeft(void);
s16 Distortion_GetType(void);
void Distortion_SetType(s32 type);
void Distortion_ClearType(s32 type);
void Distortion_RemoveRequest(s32 type);
void Distortion_Init(PlayState* play);
void Distortion_Update(void);
+20 -20
View File
@@ -119,23 +119,23 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2);
OLib_Vec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF);
break;
default: // CS_CAM_REL_0
@@ -147,24 +147,24 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
csCamera->camera->at.y += func_80163660(&player->actor);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1);
OLib_Vec3fAdd(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2);
OLib_Vec3fAdd(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD);
break;
default: // CS_CAM_REL_0
@@ -189,23 +189,23 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
OLib_Vec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF);
break;
default: // CS_CAM_REL_0
@@ -217,24 +217,24 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
csCamera->camera->eye.y += func_80163660(&player->actor);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
OLib_Vec3fAdd(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
OLib_Vec3fAdd(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD);
break;
default: // CS_CAM_REL_0
+12 -13
View File
@@ -2574,7 +2574,7 @@ void Actor_Draw(PlayState* play, Actor* actor) {
(actor->flags & (ACTOR_FLAG_10000000 | ACTOR_FLAG_400000)) ? NULL : &actor->world.pos, play);
Lights_Draw(light, play->state.gfxCtx);
if (actor->flags & ACTOR_FLAG_1000) {
if (actor->flags & ACTOR_FLAG_IGNORE_QUAKE) {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.quakeOffset.x,
actor->world.pos.y +
((actor->shape.yOffset * actor->scale.y) + play->mainCamera.quakeOffset.y),
@@ -3791,30 +3791,29 @@ void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
void Actor_RequestQuake(PlayState* play, s16 y, s16 duration) {
s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetDuration(quakeIndex, duration);
}
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed) {
s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, speed);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetDuration(quakeIndex, duration);
}
// Actor_RequestRumble?
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown) {
if (y >= 5) {
void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration) {
if (quakeY >= 5) {
Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150);
} else {
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
}
Actor_AddQuake(play, y, countdown);
Actor_RequestQuake(play, quakeY, quakeDuration);
}
typedef struct {
+2 -2
View File
@@ -699,7 +699,7 @@ f32 D_801B9E60 = 0.0f;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo1.s")
// Data for opening chests (default)
VecSph D_801B9E64[] = {
VecGeo D_801B9E64[] = {
{ 50.0f, 0xEE3A, 0xD558 },
{ 75.0f, 0x0000, 0x8008 },
{ 80.0f, 0xEE3A, 0x8008 },
@@ -713,7 +713,7 @@ Vec3f D_801B9E84[] = {
};
// Data for opening chests (goron)
VecSph D_801B9EB4[] = {
VecGeo D_801B9EB4[] = {
{ 60.0f, 0xEE3A, 0xD558 },
{ 95.0f, 0x0000, 0x8008 },
{ 90.0f, 0xEE3A, 0x8008 },
+2 -2
View File
@@ -3795,12 +3795,12 @@ s32 sCameraHudVisibility = 2;
s32 sCameraLetterboxSize = 32;
s32 sCameraNegOne = -1;
// VecSph yaw data
// VecGeo yaw data
s16 D_801B9E18[] = {
0x0AAA, 0xF556, 0x1555, 0xEAAB, 0x2AAA, 0xD556, 0x3FFF, 0xC001, 0x5555, 0xAAAB, 0x6AAA, 0x9556, 0x7FFF, 0x0000,
};
// VecSph pitch data
// VecGeo pitch data
s16 D_801B9E34[] = {
0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, 0xFD3A, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, 0xFA74, 0x0000,
};
+9 -9
View File
@@ -202,10 +202,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_MEDIUM:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
Quake_SetPerturbations(sCutsceneQuakeIndex, 6, 4, 0, 0);
Quake_SetDuration(sCutsceneQuakeIndex, 800);
}
break;
@@ -310,10 +310,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_STRONG:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 30000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
Quake_SetPerturbations(sCutsceneQuakeIndex, 20, 10, 0, 0);
Quake_SetDuration(sCutsceneQuakeIndex, 800);
}
break;
@@ -372,10 +372,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_WEAK:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
Quake_SetPerturbations(sCutsceneQuakeIndex, 2, 1, 0, 0);
Quake_SetDuration(sCutsceneQuakeIndex, 800);
}
break;
+54 -50
View File
@@ -100,16 +100,16 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
}
/**
* Takes the geographic point `sph` and converts it into a x,y,z position
* Takes the geographic point `geo` and converts it into a x,y,z position
*/
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) {
VecSph geo;
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo) {
VecSph sph;
geo.r = sph->r;
geo.pitch = 0x4000 - sph->pitch;
geo.yaw = sph->yaw;
sph.r = geo->r;
sph.pitch = 0x4000 - geo->pitch;
sph.yaw = geo->yaw;
return OLib_VecSphToVec3f(dest, &geo);
return OLib_VecSphToVec3f(dest, &sph);
}
/**
@@ -117,16 +117,16 @@ Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) {
*/
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
VecSph sph;
f32 distSquared = SQ(vec->x) + SQ(vec->z);
f32 dist = sqrtf(distSquared);
f32 distXZSq = SQ(vec->x) + SQ(vec->z);
f32 distXZ = sqrtf(distXZSq);
if ((dist == 0.0f) && (vec->y == 0.0f)) {
if ((distXZ == 0.0f) && (vec->y == 0.0f)) {
sph.pitch = 0;
} else {
sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(func_80086B30(dist, vec->y)));
sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(func_80086B30(distXZ, vec->y)));
}
sph.r = sqrtf(SQ(vec->y) + distSquared);
sph.r = sqrtf(SQ(vec->y) + distXZSq);
if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
sph.yaw = 0;
} else {
@@ -141,7 +141,7 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
/**
* Takes the point `vec`, and converts it to a geographic coordinate
*/
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) {
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec) {
VecSph sph;
OLib_Vec3fToVecSph(&sph, vec);
@@ -156,42 +156,42 @@ VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) {
* Takes the differences of positions `a` and `b`, and converts them to spherical coordinates
*/
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) {
Vec3f sph;
Vec3f diff;
sph.x = b->x - a->x;
sph.y = b->y - a->y;
sph.z = b->z - a->z;
diff.x = b->x - a->x;
diff.y = b->y - a->y;
diff.z = b->z - a->z;
return OLib_Vec3fToVecSph(dest, &sph);
return OLib_Vec3fToVecSph(dest, &diff);
}
/**
* Takes the difference of positions `a` and `b`, and converts them to geographic coordinates
*/
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b) {
Vec3f sph;
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b) {
Vec3f diff;
sph.x = b->x - a->x;
sph.y = b->y - a->y;
sph.z = b->z - a->z;
diff.x = b->x - a->x;
diff.y = b->y - a->y;
diff.z = b->z - a->z;
return OLib_Vec3fToVecSphGeo(dest, &sph);
return OLib_Vec3fToVecGeo(dest, &diff);
}
/**
* Takes the sum of positions `a` (x,y,z coordinates) and `sph` (geographic coordinates), result is in x,y,z position
* Takes the sum of positions `a` (x,y,z coordinates) and `geo` (geographic coordinates), result is in x,y,z position
* Identical to Quake_AddVec from OoT
*/
Vec3f* OLib_VecSphAddToVec3f(Vec3f* dest, Vec3f* a, VecSph* sph) {
Vec3f vec;
Vec3f* OLib_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f sum;
Vec3f b;
OLib_VecSphGeoToVec3f(&b, sph);
vec.x = a->x + b.x;
vec.y = a->y + b.y;
vec.z = a->z + b.z;
OLib_VecGeoToVec3f(&b, geo);
sum.x = a->x + b.x;
sum.y = a->y + b.y;
sum.z = a->z + b.z;
*dest = vec;
*dest = sum;
return dest;
}
@@ -248,46 +248,50 @@ Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) {
}
/**
* Gets a x,y,z position diff depending on the dbCamera mode
* Gets a x,y,z position diff depending on the mode
*/
void OLib_DbCameraVec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecSph sph;
void OLib_Vec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecGeo geo;
switch (mode) {
case 1:
OLib_Vec3fDiffToVecSphGeo(&sph, &a->pos, b);
sph.yaw -= a->rot.y;
OLib_VecSphGeoToVec3f(dest, &sph);
case OLIB_DIFF_OFFSET:
OLib_Vec3fDiffToVecGeo(&geo, &a->pos, b);
geo.yaw -= a->rot.y;
OLib_VecGeoToVec3f(dest, &geo);
break;
case 2:
case OLIB_DIFF:
dest->x = b->x - a->pos.x;
dest->y = b->y - a->pos.y;
dest->z = b->z - a->pos.z;
break;
default:
default: // OLIB_DIFF_COPY
*dest = *b;
break;
}
}
/**
* Gets a x,y,z position sum depending on the dbCamera mode
* Gets a x,y,z position sum depending on the mode
*/
void OLib_DbCameraVec3fSum(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecSph sph;
void OLib_Vec3fAdd(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecGeo geo;
switch (mode) {
case 1:
OLib_Vec3fToVecSphGeo(&sph, b);
sph.yaw += a->rot.y;
OLib_VecSphAddToVec3f(dest, &a->pos, &sph);
case OLIB_ADD_OFFSET:
OLib_Vec3fToVecGeo(&geo, b);
geo.yaw += a->rot.y;
OLib_AddVecGeoToVec3f(dest, &a->pos, &geo);
break;
case 2:
case OLIB_ADD:
dest->x = a->pos.x + b->x;
dest->y = a->pos.y + b->y;
dest->z = a->pos.z + b->z;
break;
default:
default: // OLIB_ADD_COPY
*dest = *b;
break;
}
+14 -14
View File
@@ -507,39 +507,39 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
if (!sIsCameraUnderwater) {
Camera_SetFlags(camera, CAM_STATE_UNDERWATER);
sQuakeIndex = -1;
Distortion_SetType(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_SetCountdown(80);
Distortion_Request(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_SetDuration(80);
}
func_801A3EC0(0x20);
func_800F6834(this, lightIndex);
if ((sQuakeIndex == -1) || (Quake_GetCountdown(sQuakeIndex) == 10)) {
s16 quakeIndex = Quake_Add(camera, QUAKE_TYPE_5);
if ((sQuakeIndex == -1) || (Quake_GetTimeLeft(sQuakeIndex) == 10)) {
s16 quakeIndex = Quake_Request(camera, QUAKE_TYPE_5);
sQuakeIndex = quakeIndex;
if (quakeIndex != 0) {
Quake_SetSpeed(sQuakeIndex, 550);
Quake_SetQuakeValues(sQuakeIndex, 1, 1, 180, 0);
Quake_SetCountdown(sQuakeIndex, 1000);
Quake_SetPerturbations(sQuakeIndex, 1, 1, 180, 0);
Quake_SetDuration(sQuakeIndex, 1000);
}
}
if (player->stateFlags3 & PLAYER_STATE3_8000) {
Distortion_SetType(DISTORTION_TYPE_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_Request(DISTORTION_TYPE_ZORA_SWIMMING);
Distortion_RemoveRequest(DISTORTION_TYPE_NON_ZORA_SWIMMING);
} else {
Distortion_SetType(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_ZORA_SWIMMING);
Distortion_Request(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_RemoveRequest(DISTORTION_TYPE_ZORA_SWIMMING);
}
} else {
if (sIsCameraUnderwater) {
Camera_ClearFlags(camera, CAM_STATE_UNDERWATER);
}
Distortion_ClearType(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_ClearType(DISTORTION_TYPE_ZORA_SWIMMING);
Distortion_RemoveRequest(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_RemoveRequest(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_RemoveRequest(DISTORTION_TYPE_ZORA_SWIMMING);
if (sQuakeIndex != 0) {
Quake_Remove(sQuakeIndex);
Quake_RemoveRequest(sQuakeIndex);
}
func_800F694C(this);
func_801A3EC0(0);
+350 -304
View File
File diff suppressed because it is too large Load Diff
@@ -522,10 +522,10 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z;
Rumble_Request(Math3D_Vec3fDistSq(&sp44, &GET_PLAYER(play)->actor.world.pos), 255, 20, 150);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
Quake_SetPerturbations(quakeIndex, 7, 0, 0, 0);
Quake_SetDuration(quakeIndex, 12);
if (this->unk_179 <= 0) {
func_8019F128(NA_SE_EV_STONEDOOR_STOP);
@@ -537,7 +537,7 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
}
}
void func_80A9C18C(BgHakuginPost* this, PlayState* play) {
void BgHakuginPost_RequestQuakeAndRumble(BgHakuginPost* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
Camera* activeCam = GET_ACTIVE_CAM(play);
@@ -547,10 +547,10 @@ void func_80A9C18C(BgHakuginPost* this, PlayState* play) {
this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.z),
255, 20, 150);
quakeIndex = Quake_Add(activeCam, QUAKE_TYPE_3);
quakeIndex = Quake_Request(activeCam, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, 6, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20);
Quake_SetPerturbations(quakeIndex, 6, 0, 0, 0);
Quake_SetDuration(quakeIndex, 20);
}
void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) {
@@ -798,7 +798,7 @@ void func_80A9CD14(BgHakuginPost* this, PlayState* play) {
temp_f12 = CLAMP_MAX(temp_f12, 40.0f);
this->unk_16C += temp_f12;
if (this->unk_168 <= this->unk_16C) {
func_80A9C18C(this, play);
BgHakuginPost_RequestQuakeAndRumble(this, play);
func_8019F128(NA_SE_EV_STONEDOOR_STOP);
func_80A9CE00(this);
} else {
@@ -876,7 +876,7 @@ void func_80A9D0B4(BgHakuginPost* this, PlayState* play) {
func_80A9C634(this, play);
func_80A9B160(&D_80A9E028, play);
this->unk_16C = this->unk_164;
func_80A9C18C(this, play);
BgHakuginPost_RequestQuakeAndRumble(this, play);
func_8019F128(NA_SE_EV_STONEDOOR_STOP);
func_80A9CC84(this);
} else {
@@ -228,11 +228,11 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) {
Actor_MoveWithGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetDuration(quakeIndex, 12);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
}
@@ -832,11 +832,11 @@ void func_80B81A80(Actor* thisx, PlayState* play) {
func_80B81B84(this);
} else if (this->unk_584 == 15) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, 6, 0, 100, 0);
Quake_SetCountdown(quakeIndex, 22);
Quake_SetPerturbations(quakeIndex, 6, 0, 100, 0);
Quake_SetDuration(quakeIndex, 22);
}
}
@@ -859,11 +859,11 @@ void func_80B81BA0(Actor* thisx, PlayState* play) {
thisx->shape.rot.x += 0x1F4;
if (!(this->unk_584 & 7)) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
Quake_SetCountdown(quakeIndex, 15);
Quake_SetPerturbations(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
Quake_SetDuration(quakeIndex, 15);
}
if (Flags_GetSwitch(play, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
@@ -929,11 +929,11 @@ void func_80B81DC8(Actor* thisx, PlayState* play) {
CutsceneManager_Stop(this->dyna.actor.csId);
func_80B818B4(this);
} else if (this->unk_584 == 19) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 5, 0, 40, 60);
Quake_SetCountdown(quakeIndex, 17);
Quake_SetPerturbations(quakeIndex, 5, 0, 40, 60);
Quake_SetDuration(quakeIndex, 17);
}
}
@@ -151,10 +151,10 @@ void func_80BD5A18(BgIkanaShutter* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.978f;
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12);
Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetDuration(quakeIndex, 12);
func_80BD5828(this);
}
@@ -69,19 +69,20 @@ void func_80C0A838(BgIkninSusceil* this, PlayState* play) {
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80C0A86C(BgIkninSusceil* this, PlayState* play, s16 verticalMag, s16 countdown, s32 arg4) {
void BgIkninSusceil_RequestQuakeAndRumble(BgIkninSusceil* this, PlayState* play, s16 quakeY, s16 quakeDuration,
s32 rumbleType) {
s32 pad;
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown);
Quake_SetPerturbations(quakeIndex, quakeY, 0, 0, 0);
Quake_SetDuration(quakeIndex, quakeDuration);
if (arg4 == 1) {
if (rumbleType == 1) {
Rumble_Request(SQ(100.0f), 255, 20, 150);
} else if (arg4 == 2) {
} else if (rumbleType == 2) {
Rumble_Request(SQ(100.0f), 180, 20, 100);
} else if (arg4 == 3) {
} else if (rumbleType == 3) {
Rumble_Request(SQ(100.0f), 120, 20, 10);
}
}
@@ -154,7 +155,7 @@ void func_80C0ABA8(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.93f;
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
func_80C0A86C(this, play, 4, 14, 1);
BgIkninSusceil_RequestQuakeAndRumble(this, play, 4, 14, 1);
Flags_UnsetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor));
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
func_80C0AC74(this);
@@ -197,7 +198,7 @@ void func_80C0AD64(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.98f;
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 365.0f, 0.5f,
this->dyna.actor.velocity.y, 1.0f) < 0.1f) {
func_80C0A86C(this, play, 1, 14, 3);
BgIkninSusceil_RequestQuakeAndRumble(this, play, 1, 14, 3);
CutsceneManager_Stop(this->dyna.actor.csId);
func_80C0AB14(this);
} else {
@@ -216,7 +217,7 @@ void func_80C0AE5C(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y = CLAMP_MIN(this->dyna.actor.velocity.y, 1.0f);
this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.velocity.y;
if ((this->dyna.actor.home.pos.y + 365.0f) < this->dyna.actor.world.pos.y) {
func_80C0A86C(this, play, 3, 14, 2);
BgIkninSusceil_RequestQuakeAndRumble(this, play, 3, 14, 2);
func_80C0AB14(this);
}
}
@@ -151,10 +151,10 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10);
Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetDuration(quakeIndex, 10);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
+2 -2
View File
@@ -1050,7 +1050,7 @@ void Boss03_Charge(Boss03* this, PlayState* play) {
// Attack platform
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 20, 15);
Actor_RequestQuakeAndRumble(&this->actor, play, 20, 15);
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96,
ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE);
@@ -1773,7 +1773,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
play_sound(NA_SE_IT_WALL_HIT_HARD);
func_800BC848(&this->actor, play, 10, 10);
Actor_RequestQuakeAndRumble(&this->actor, play, 10, 10);
}
} else {
Math_ApproachS(&this->actor.shape.rot.z, -0x6000, 0xA, 0x900);

Some files were not shown because too many files have changed in this diff Show More