Merge branch 'master' of https://gitlab.com/banjo.decomp/banjo-kazooie into document/fileprogress
This commit is contained in:
103
src/core2/ba/flap.c
Normal file
103
src/core2/ba/flap.c
Normal file
@@ -0,0 +1,103 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* .bss */
|
||||
u8 s_active;
|
||||
f32 s_flap_max_timer;
|
||||
f32 s_flap_list[5];
|
||||
|
||||
/* .code */
|
||||
|
||||
/**
|
||||
* @brief returns the number of nonzero flap timers in `s_flap_list`
|
||||
*
|
||||
* @return s32 number of active flaps
|
||||
*/
|
||||
s32 baflap_getCount(void) {
|
||||
s32 i;
|
||||
s32 cnt;
|
||||
|
||||
cnt = 0;
|
||||
for(i = 0; i < 5; i++){
|
||||
if(s_flap_list[i] != 0.0f){
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief add a flap duration to the flap list
|
||||
*
|
||||
* @param duration duration of flap in seconds
|
||||
* @return true if baflap duration was extended
|
||||
* @return false if baflap does not extend duration or all timers in flap queue are occupied
|
||||
*/
|
||||
bool baflap_add(f32 duration) {
|
||||
s32 i;
|
||||
|
||||
// check that timer is far enough away from any value
|
||||
for(i = 0; i < 5; i++){
|
||||
if(duration - 0.25 < s_flap_list[i]){
|
||||
s_flap_max_timer = duration;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
// add to list
|
||||
for(i = 0; i < 5; i++){
|
||||
if (s_flap_list[i] == 0.0f) {
|
||||
s_flap_list[i] = duration;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
s_flap_max_timer = duration;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief zeros all flap timers and sets as inactive
|
||||
*
|
||||
*/
|
||||
void baflap_reset(void) {
|
||||
s32 i;
|
||||
|
||||
for(i = 0; i < 5; i++){
|
||||
s_flap_list[i] = 0.0f;
|
||||
}
|
||||
s_active = s_flap_max_timer = 0.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief activates or deactivates flap timers
|
||||
*
|
||||
* @param active false (0) or true (!0)
|
||||
*/
|
||||
void baflap_activate(bool active){
|
||||
s_active = active;
|
||||
if(!s_active){
|
||||
baflap_reset();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief updates flap timers if active
|
||||
*
|
||||
*/
|
||||
void baflap_update(void) {
|
||||
f32 temp_f0;
|
||||
s32 i;
|
||||
|
||||
if (s_active != 0) {
|
||||
//update timers
|
||||
for(i = 0; i < 5; i++){
|
||||
func_80259430(&s_flap_list[i]);
|
||||
}
|
||||
if (s_flap_max_timer != 0.0f) {
|
||||
temp_f0 = s_flap_max_timer;
|
||||
s_flap_max_timer = 0.0f;
|
||||
baflap_add(temp_f0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ extern void func_802A6388(f32);
|
||||
extern f32 chwadingboots_802D6E4C(Actor *);
|
||||
extern void set_turbo_duration(f32);
|
||||
extern f32 chtrainers_getDuration(Actor *);
|
||||
extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val);
|
||||
extern int ml_vec3f_point_within_horizontal_distance(f32 vec[3], f32 x, f32 z, f32 val);
|
||||
extern void func_802EE354(Actor *, s32, s32, s32, f32, f32, f32, f32 arg8[3], s32, f32 arg10[2]);
|
||||
extern void func_8035644C(s32);
|
||||
extern void func_8035646C(s32 arg0);
|
||||
|
@@ -271,9 +271,7 @@ void baModel_setVisible(s32 arg0){
|
||||
void baModel_802921D4(f32 arg0[3]){
|
||||
if(player_getWaterState() == BSWATERGROUP_0_NONE){
|
||||
D_8037C150.unk0 = 1;
|
||||
D_8037C150.unk4[0] = arg0[0];
|
||||
D_8037C150.unk4[1] = arg0[1];
|
||||
D_8037C150.unk4[2] = arg0[2];
|
||||
TUPLE_COPY(D_8037C150.unk4, arg0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,8 +3,6 @@
|
||||
#include "variables.h"
|
||||
#include "core2/ba/physics.h"
|
||||
|
||||
#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
|
||||
|
||||
extern f32 ml_sin_deg(f32);
|
||||
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
|
||||
extern void func_80256D0C(f32, f32, f32, f32, f32, f32 *, f32 *, f32 *);
|
||||
@@ -118,7 +116,8 @@ void __baphysics_update_no_gravity(void){
|
||||
//update velocity
|
||||
ml_vec3f_diff_copy(sp24, baphysics_target_velocity, s_player_velocity);
|
||||
ml_vec3f_scale(sp24, time_getDelta()*baphysics_acceleration);
|
||||
if(_SQ3v1(sp24) < 0.02){
|
||||
|
||||
if (LENGTH_SQ_VEC3F(sp24) < 0.02) {
|
||||
ml_vec3f_copy(s_player_velocity, baphysics_target_velocity);
|
||||
}
|
||||
else{
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#include "variables.h"
|
||||
#include <core1/viewport.h>
|
||||
#include "core2/ba/physics.h"
|
||||
#include "core2/ba/flap.h"
|
||||
|
||||
extern void func_8028FDC8(f32);
|
||||
extern void baModel_setYDisplacement(f32);
|
||||
extern f32 func_8029B2D0(void);
|
||||
extern void ncDynamicCam4_func_802BFE50(f32, f32, f32);
|
||||
@@ -56,8 +56,8 @@ void func_802A3430(void){
|
||||
func_802A33D8();
|
||||
func_80293D48(60.0f, 45.0f);
|
||||
func_80294378(4);
|
||||
func_8028FEF0();
|
||||
func_8028FFBC(1);
|
||||
baflap_reset();
|
||||
baflap_activate(1);
|
||||
}
|
||||
|
||||
void func_802A34C8(void){
|
||||
@@ -71,7 +71,7 @@ void func_802A34C8(void){
|
||||
func_80291548();
|
||||
func_80293D74();
|
||||
func_80294378(1);
|
||||
func_8028FFBC(0);
|
||||
baflap_activate(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,13 +230,13 @@ void bsbfly_update(void){
|
||||
}
|
||||
if(D_8037D346){
|
||||
D_8037D346 = 0;
|
||||
func_8028FDC8(0.35f);
|
||||
baflap_add(0.35f);
|
||||
}else{
|
||||
func_8028FDC8(1.0f);
|
||||
baflap_add(1.0f);
|
||||
}
|
||||
}//L802A3BB4
|
||||
|
||||
sp30 = func_8028FD30();
|
||||
sp30 = baflap_getCount();
|
||||
switch(D_8037D344){
|
||||
case 0:
|
||||
if(sp30)
|
||||
@@ -306,7 +306,7 @@ void bsbfly_update(void){
|
||||
if(func_802A3350())
|
||||
sp54 = BS_1_IDLE;
|
||||
|
||||
func_8028FFF0();
|
||||
baflap_update();
|
||||
bs_setState(sp54);
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "variables.h"
|
||||
|
||||
#include "core2/ba/physics.h"
|
||||
#include "core2/ba/flap.h"
|
||||
|
||||
|
||||
void func_80354030(f32*, f32);
|
||||
@@ -14,7 +15,6 @@ void ncDynamicCam4_func_802BFE50(f32, f32, f32);
|
||||
void yaw_setVelocityBounded(f32, f32);
|
||||
f32 func_8029B2D0(void);
|
||||
f32 func_8029B2DC(void);
|
||||
void func_8028FDC8(f32);
|
||||
void func_80290B40(f32);
|
||||
void func_80290A6C(void);
|
||||
|
||||
@@ -98,7 +98,7 @@ void _bsbeefly_end(void){
|
||||
func_80291548();
|
||||
baphysics_reset_gravity();
|
||||
baphysics_reset_terminal_velocity();
|
||||
func_8028FFBC(0);
|
||||
baflap_activate(0);
|
||||
func_8029099C();
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ void func_802A07F8(void){
|
||||
func_802A0724();
|
||||
baphysics_set_gravity(-300.0f);
|
||||
baphysics_set_terminal_velocity(-99.9f);
|
||||
func_8028FEF0();
|
||||
func_8028FFBC(1);
|
||||
baflap_reset();
|
||||
baflap_activate(1);
|
||||
func_802909C4();
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void bsbeefly_enter(void){
|
||||
func_802914CC(4);
|
||||
func_802A07F8();
|
||||
if(mvmnt != 0x8b){
|
||||
func_8028FDC8(1.0f);
|
||||
baflap_add(1.0f);
|
||||
D_8037D2C0 = 0;
|
||||
}
|
||||
else {
|
||||
@@ -186,12 +186,12 @@ void bsbeefly_update(void){
|
||||
_bsBeeFly_updatePitch();
|
||||
pitch_get(); //return value never used
|
||||
if(button_pressed(BUTTON_A) && (player_getYPosition() < 7500.0)){
|
||||
func_8028FDC8(1.0f);
|
||||
baflap_add(1.0f);
|
||||
}
|
||||
if(!func_8028FD30() && player_inWater()){
|
||||
func_8028FDC8(1.0f);
|
||||
if((baflap_getCount() == 0) && player_inWater()){
|
||||
baflap_add(1.0f);
|
||||
}
|
||||
sp44 = func_8028FD30();
|
||||
sp44 = baflap_getCount();
|
||||
animctrl_setDuration(sp48, D_803649B0[sp44]);
|
||||
sp24 = &D_803649C4[sp44];
|
||||
sp40 = 0.9f;
|
||||
@@ -255,7 +255,7 @@ void bsbeefly_update(void){
|
||||
baphysics_set_target_horizontal_velocity(sp38);
|
||||
if(player_isStable() && !player_inWater())
|
||||
sp4C = BS_85_BEE_IDLE;
|
||||
func_8028FFF0();
|
||||
baflap_update();
|
||||
bs_setState(sp4C);
|
||||
}
|
||||
|
||||
|
@@ -90,7 +90,7 @@ f32 func_802D7038(Actor *this) {
|
||||
void func_802D7124(Actor *actor, f32 arg1) {
|
||||
f32 vp[3];
|
||||
|
||||
viewport_getPosition_vec3f(&vp);
|
||||
viewport_getPosition_vec3f(vp);
|
||||
if ((actor->position[0] - vp[0]) * (actor->position[0] - vp[0]) + (actor->position[2] - vp[2]) * (actor->position[2] - vp[2]) < 12250000.0f) {
|
||||
func_802D729C(actor, arg1);
|
||||
}
|
||||
|
@@ -6,15 +6,26 @@
|
||||
extern f32 mapModel_getFloorY(f32[3]);
|
||||
extern f32 func_80257204(f32, f32, f32, f32);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
} ActorLocal_Core2_D89E0;
|
||||
typedef enum {
|
||||
CH_BAT_STATE_ROOSTING = 1,
|
||||
CH_BAT_STATE_EXIT_ROOST = 2,
|
||||
CH_BAT_STATE_CHASE = 3,
|
||||
CH_BAT_STATE_ROAM = 4,
|
||||
CH_BAT_STATE_FLY_HOME = 5,
|
||||
CH_BAT_STATE_ENTER_ROOST = 6,
|
||||
CH_BAT_STATE_FALL = 7,
|
||||
CH_BAT_STATE_DIE = 8
|
||||
} ChBatState;
|
||||
|
||||
void func_80360828(Actor *this);
|
||||
typedef struct {
|
||||
f32 cooldown; //cooldown timer after attacking the player
|
||||
f32 roost_yaw;
|
||||
} ChBatLocal;
|
||||
|
||||
void chbat_update(Actor *this);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo D_80373090[] = {
|
||||
ActorAnimationInfo sChBatAnimations[] = {
|
||||
{0, 0.0f},
|
||||
{ ASSET_AE_ANIM_BAT_ROOST, 12.0f},
|
||||
{ ASSET_AD_ANIM_BAT_TAKE_FLIGHT, 0.3f},
|
||||
@@ -26,53 +37,53 @@ ActorAnimationInfo D_80373090[] = {
|
||||
{ ASSET_2AA_ANIM_BAT_DIE, 0.85f},
|
||||
};
|
||||
|
||||
ActorInfo D_803730D8 = {
|
||||
ActorInfo gChBat = {
|
||||
MARKER_127_BAT, ACTOR_163_BAT, ASSET_3CA_MODEL_BAT,
|
||||
0x1, D_80373090,
|
||||
func_80360828, func_80326224, actor_draw,
|
||||
CH_BAT_STATE_ROOSTING, sChBatAnimations,
|
||||
chbat_update, func_80326224, actor_draw,
|
||||
2500, 0, 0.9f, 0
|
||||
};
|
||||
|
||||
/* .code */
|
||||
void func_8035F970(Actor *this){
|
||||
subaddie_set_state(this, 1);
|
||||
void chbat_roost(Actor *this){
|
||||
subaddie_set_state(this, CH_BAT_STATE_ROOSTING);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
|
||||
void func_8035F99C(Actor *this){
|
||||
void chbat_exitRoost(Actor *this){
|
||||
if(!volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){
|
||||
subaddie_set_state_with_direction(this, 2, 0.01f, 1);
|
||||
subaddie_set_state_with_direction(this, CH_BAT_STATE_EXIT_ROOST, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
this->actor_specific_1_f = 5.0f;
|
||||
FUNC_8030E8B4(SFX_419_UNKNOWN, 1.0f, 28000, this->position, 0x4e2, 0x9c4);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8035FA0C(Actor *this){
|
||||
subaddie_set_state(this, 3);
|
||||
void chbat_chase(Actor *this){
|
||||
subaddie_set_state(this, CH_BAT_STATE_CHASE);
|
||||
actor_loopAnimation(this);
|
||||
this->actor_specific_1_f = 5.0f;
|
||||
}
|
||||
|
||||
void func_8035FA48(Actor *this){
|
||||
subaddie_set_state(this, 4);
|
||||
void chbat_roam(Actor *this){
|
||||
subaddie_set_state(this, CH_BAT_STATE_ROAM);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
|
||||
void func_8035FA74(Actor *this){
|
||||
ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local;
|
||||
this->yaw_ideal = local->unk4;
|
||||
subaddie_set_state(this, 5);
|
||||
void chbat_flyHome(Actor *this){
|
||||
ChBatLocal *local = (ChBatLocal *)&this->local;
|
||||
this->yaw_ideal = local->roost_yaw;
|
||||
subaddie_set_state(this, CH_BAT_STATE_FLY_HOME);
|
||||
actor_loopAnimation(this);
|
||||
}
|
||||
|
||||
void func_8035FAA8(Actor *this){
|
||||
subaddie_set_state_with_direction(this, 6, 0.99f, 0);
|
||||
void chbat_enterRoost(Actor *this){
|
||||
subaddie_set_state_with_direction(this, CH_BAT_STATE_ENTER_ROOST, 0.99f, 0);
|
||||
actor_playAnimationOnce(this);
|
||||
}
|
||||
|
||||
void func_8035FAE0(Actor *this){
|
||||
subaddie_set_state_with_direction(this, 7, 0.01f, 1);
|
||||
void chBat_fall(Actor *this){
|
||||
subaddie_set_state_with_direction(this, CH_BAT_STATE_FALL, 0.01f, 1);
|
||||
actor_loopAnimation(this);
|
||||
this->yaw += 180.0f;
|
||||
this->actor_specific_1_f = 20.0f;
|
||||
@@ -80,7 +91,7 @@ void func_8035FAE0(Actor *this){
|
||||
|
||||
}
|
||||
|
||||
int func_8035FB48(Actor * this, s32 dist){
|
||||
int chbat_isWithinHorzontalRadiusOfHome(Actor * this, s32 dist){
|
||||
f32 f0 = this->position_x - this->unk1C_x;
|
||||
f32 f2 = this->position_z - this->unk1C_z;
|
||||
if(f0*f0 + f2*f2 < dist*dist)
|
||||
@@ -89,7 +100,7 @@ int func_8035FB48(Actor * this, s32 dist){
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool func_8035FBA8(Actor *arg0, s32 arg1) {
|
||||
bool chbat_nearHome(Actor *arg0, s32 arg1) {
|
||||
if( (arg0->position[1] < ( arg0->unk1C[1] + 0.5))
|
||||
&& (( arg0->unk1C[1] - 0.5) < arg0->position[1])
|
||||
) {
|
||||
@@ -98,17 +109,17 @@ bool func_8035FBA8(Actor *arg0, s32 arg1) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void func_8035FC20(Actor *this, f32 arg1, f32 arg2){
|
||||
if(this->position[1] < arg1){
|
||||
this->position[1] += arg2;
|
||||
if(arg1 < this->position[1]){
|
||||
this->position[1] = arg1;
|
||||
void chBat_updateHeight(Actor *this, f32 target_height, f32 velocity){
|
||||
if(this->position[1] < target_height){
|
||||
this->position[1] += velocity;
|
||||
if(target_height < this->position[1]){
|
||||
this->position[1] = target_height;
|
||||
}
|
||||
}
|
||||
else if(arg1 < this->position[1]){
|
||||
this->position[1] -= arg2;
|
||||
if(this->position[1] < arg1){
|
||||
this->position[1] = arg1;
|
||||
else if(target_height < this->position[1]){
|
||||
this->position[1] -= velocity;
|
||||
if(this->position[1] < target_height){
|
||||
this->position[1] = target_height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,13 +132,8 @@ bool func_8035FC98(Actor *this, f32 arg1){
|
||||
if(this->unk38_0)
|
||||
return FALSE;
|
||||
|
||||
sp28[0] = this->position[0];
|
||||
sp28[1] = this->position[1];
|
||||
sp28[2] = this->position[2];
|
||||
|
||||
sp1C[0] = sp28[0];
|
||||
sp1C[1] = sp28[1];
|
||||
sp1C[2] = sp28[2];
|
||||
TUPLE_COPY(sp28, this->position);
|
||||
TUPLE_COPY(sp1C, sp28);
|
||||
sp1C[1] += arg1;
|
||||
|
||||
if (func_80309B48(sp28, sp1C, sp34, 0x5E0000) != NULL)
|
||||
@@ -145,7 +151,7 @@ bool func_8035FD28(Actor *this){
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool func_8035FDA4(Actor *this) {
|
||||
bool chbat_nearPlayer(Actor *this) {
|
||||
f32 sp24[3];
|
||||
|
||||
player_getPosition(sp24);
|
||||
@@ -205,17 +211,17 @@ void func_8035FFAC(Actor *this, f32 arg1){
|
||||
}
|
||||
}
|
||||
|
||||
void func_80360044(Actor *this) {
|
||||
f32 var_f0;
|
||||
void chbat_updateFlyingRoll(Actor *this) {
|
||||
f32 d_yaw;
|
||||
|
||||
var_f0 = this->yaw_ideal - this->yaw;
|
||||
if (var_f0 >= 180.0f) {
|
||||
var_f0 -= 360.0f;
|
||||
d_yaw = this->yaw_ideal - this->yaw;
|
||||
if (d_yaw >= 180.0f) {
|
||||
d_yaw -= 360.0f;
|
||||
}
|
||||
if (var_f0 < -180.0f) {
|
||||
var_f0 += 360.0f;
|
||||
if (d_yaw < -180.0f) {
|
||||
d_yaw += 360.0f;
|
||||
}
|
||||
this->velocity[2] = -var_f0;
|
||||
this->velocity[2] = -d_yaw;
|
||||
if (( this->roll < this->velocity[2]) && ( this->roll < 55.0f)) {
|
||||
this->roll += 2.0f;
|
||||
}
|
||||
@@ -224,7 +230,7 @@ void func_80360044(Actor *this) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80360130(Actor *this){
|
||||
void chbat_updateRollTowardsZero(Actor *this){
|
||||
if(0.0f < this->roll){
|
||||
this->roll -= 2.0;
|
||||
}
|
||||
@@ -236,11 +242,11 @@ void func_80360130(Actor *this){
|
||||
bool func_80360198(Actor *this) {
|
||||
f32 var_f16;
|
||||
f64 temp_f0;
|
||||
f64 var_f0;
|
||||
f64 var_f0_2;
|
||||
f64 d_yaw;
|
||||
f64 d_yaw_2;
|
||||
|
||||
func_80328FB0(this, 5.0f);
|
||||
func_80360044(this);
|
||||
chbat_updateFlyingRoll(this);
|
||||
this->actor_specific_1_f += (this->velocity[1] * 0.45) - (0.001 * this->actor_specific_1_f);
|
||||
if (this->actor_specific_1_f > 13.0) {
|
||||
this->actor_specific_1_f = 13.0f;
|
||||
@@ -264,7 +270,7 @@ bool func_80360198(Actor *this) {
|
||||
this->position[1] += this->velocity[0];
|
||||
}
|
||||
|
||||
if (this->state == 4) {
|
||||
if (this->state == CH_BAT_STATE_ROAM) {
|
||||
if (func_8035FF5C(this) == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -279,24 +285,22 @@ f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){
|
||||
f32 dy;
|
||||
f32 D1, D2;
|
||||
f32 unused;
|
||||
f32 sp20[3];
|
||||
f32 player_position[3];
|
||||
|
||||
switch (arg2) {
|
||||
case 1:
|
||||
player_getPosition(sp20);
|
||||
player_getPosition(player_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sp20[0] = this->unk1C[0];
|
||||
sp20[1] = this->unk1C[1];
|
||||
sp20[2] = this->unk1C[2];
|
||||
TUPLE_COPY(player_position, this->unk1C);
|
||||
break;
|
||||
}
|
||||
|
||||
D1 = SQ(this->position[0] - sp20[0]);
|
||||
D2 = SQ(this->position[2] - sp20[2]);
|
||||
D1 = SQ(this->position[0] - player_position[0]);
|
||||
D2 = SQ(this->position[2] - player_position[2]);
|
||||
|
||||
dy = this->position[1] - sp20[1] - arg1;
|
||||
dy = this->position[1] - player_position[1] - arg1;
|
||||
|
||||
if(dy == 0.0 || D1 + D2 == 0.0)
|
||||
return 0.0f;
|
||||
@@ -322,18 +326,19 @@ int func_803604E8(Actor *this){
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool func_8036054C(Actor *this) {
|
||||
bool chbat_updateRoam(Actor *this) {
|
||||
s32 phi_v0;
|
||||
s32 phi_s1;
|
||||
s32 phi_s2;
|
||||
|
||||
if (this->lifetime_value == 0.0f) {
|
||||
// fly towards home if lifetime is done
|
||||
this->yaw_ideal = func_80257204(this->position[0], this->position[2], this->unk1C[0], this->unk1C[2]);
|
||||
func_8035FFAC(this, func_803603AC(this, -110, 2));
|
||||
}
|
||||
else{
|
||||
func_80328FB0(this, 5.0f);
|
||||
func_80360044(this);
|
||||
func_80328FB0(this, 5.0f); //update yaw
|
||||
chbat_updateFlyingRoll(this);
|
||||
if (func_80329480(this) != 0) {
|
||||
this->lifetime_value = 0.0f;
|
||||
} else {
|
||||
@@ -346,9 +351,9 @@ bool func_8036054C(Actor *this) {
|
||||
phi_s1 = 0;
|
||||
do{
|
||||
if (this->unk38_0) {
|
||||
phi_v0 = func_80329140(this, (s32) this->yaw_ideal, 0xC8);
|
||||
phi_v0 = func_80329140(this, (s32) this->yaw_ideal, 200);
|
||||
} else {
|
||||
phi_v0 = func_80329078(this, (s32) this->yaw_ideal, 0xC8);
|
||||
phi_v0 = func_80329078(this, (s32) this->yaw_ideal, 200);
|
||||
}
|
||||
|
||||
if(phi_v0 == 0){
|
||||
@@ -371,64 +376,62 @@ bool func_8036054C(Actor *this) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void func_80360790(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
void chBat_dieCollision(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local;
|
||||
func_8035FAE0(this);
|
||||
local->unk0 = 0.0f;
|
||||
ChBatLocal *local = (ChBatLocal *)&this->local;
|
||||
chBat_fall(this);
|
||||
local->cooldown = 0.0f;
|
||||
this->marker->collidable = FALSE;
|
||||
FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.3f, 26000, this->position, 1250, 2500);
|
||||
}
|
||||
|
||||
void func_803607FC(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
void chBat_attackCollision(ActorMarker *this_marker, ActorMarker *other_marker){
|
||||
Actor *this = marker_getActor(this_marker);
|
||||
ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local;
|
||||
local->unk0 = 0.8f;
|
||||
ChBatLocal *local = (ChBatLocal *)&this->local;
|
||||
local->cooldown = 0.8f;
|
||||
}
|
||||
|
||||
void func_80360828(Actor *this){
|
||||
f32 sp3C = time_getDelta();
|
||||
ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local;
|
||||
void chbat_update(Actor *this){
|
||||
f32 dt = time_getDelta();
|
||||
ChBatLocal *local = (ChBatLocal *)&this->local;
|
||||
f32 sp34;
|
||||
|
||||
if(!this->initialized){
|
||||
this->initialized = TRUE;
|
||||
marker_setCollisionScripts(this->marker, NULL, func_803607FC, func_80360790);
|
||||
marker_setCollisionScripts(this->marker, NULL, chBat_attackCollision, chBat_dieCollision);
|
||||
this->unk38_0 = FALSE;
|
||||
this->actor_specific_1_f = 0.0f;
|
||||
this->velocity_x = 0.0f;
|
||||
this->unk1C_x = this->position_x;
|
||||
this->unk1C_y = this->position_y;
|
||||
this->unk1C_z = this->position_z;
|
||||
local->unk4 = this->yaw;
|
||||
TUPLE_COPY(this->unk1C, this->position); // set roost position
|
||||
local->roost_yaw = this->yaw;
|
||||
}
|
||||
if(local->unk0 <= 0.0){
|
||||
local->unk0 = 0.0f;
|
||||
if(local->cooldown <= 0.0){
|
||||
local->cooldown = 0.0f;
|
||||
}else{//L80360910
|
||||
local->unk0 -= sp3C;
|
||||
local->cooldown -= dt;
|
||||
return;
|
||||
}
|
||||
|
||||
switch(this->state){
|
||||
case 1: //L80360918
|
||||
if(func_8035FDA4(this)){
|
||||
func_8035F99C(this);
|
||||
case CH_BAT_STATE_ROOSTING: //L80360918
|
||||
if(chbat_nearPlayer(this)){
|
||||
chbat_exitRoost(this);
|
||||
}
|
||||
break;
|
||||
case 2: //L80360938
|
||||
case CH_BAT_STATE_EXIT_ROOST: //L80360938
|
||||
if( 0.98 < animctrl_getAnimTimer(this->animctrl)
|
||||
|| !func_8035FD28(this)
|
||||
){
|
||||
func_8035FA0C(this);
|
||||
chbat_chase(this);
|
||||
}
|
||||
break;
|
||||
case 3: //L8036097C
|
||||
case CH_BAT_STATE_CHASE: //L8036097C
|
||||
animctrl_setDuration(this->animctrl, 1.2 - this->velocity_y);
|
||||
if(!func_8035FDA4(this)){
|
||||
func_8035FA48(this);
|
||||
if(!chbat_nearPlayer(this)){
|
||||
chbat_roam(this);
|
||||
}
|
||||
else if(!func_803604E8(this)){
|
||||
func_8035FA48(this);
|
||||
chbat_roam(this);
|
||||
this->unk38_31 = 0x3C;
|
||||
}
|
||||
else{
|
||||
@@ -442,45 +445,45 @@ void func_80360828(Actor *this){
|
||||
func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f);
|
||||
}
|
||||
break;
|
||||
case 4: //L80360A9C
|
||||
if(func_8035FDA4(this)){
|
||||
func_8035FA0C(this);
|
||||
} else if(func_8035FB48(this, 0x14)){
|
||||
func_8035FA74(this);
|
||||
case CH_BAT_STATE_ROAM: //L80360A9C
|
||||
if(chbat_nearPlayer(this)){
|
||||
chbat_chase(this);
|
||||
} else if(chbat_isWithinHorzontalRadiusOfHome(this, 20)){
|
||||
chbat_flyHome(this);
|
||||
} else{
|
||||
func_8036054C(this);
|
||||
chbat_updateRoam(this);
|
||||
}//L80360AE8
|
||||
|
||||
if(actor_animationIsAt(this, 0.5f)){
|
||||
func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f);
|
||||
}
|
||||
break;
|
||||
case 5: //L80360B3C
|
||||
if(func_8035FDA4(this)){
|
||||
func_8035FA0C(this);
|
||||
} else if(func_8035FBA8(this, 1)){
|
||||
func_8035FAA8(this);
|
||||
case CH_BAT_STATE_FLY_HOME: //L80360B3C
|
||||
if(chbat_nearPlayer(this)){
|
||||
chbat_chase(this);
|
||||
} else if(chbat_nearHome(this, 1)){
|
||||
chbat_enterRoost(this);
|
||||
} else{
|
||||
func_80328FB0(this, 5.0f);
|
||||
func_8035FC20(this, this->unk1C_y, 2.0f);
|
||||
func_80360130(this);
|
||||
}//L80360BA0
|
||||
chBat_updateHeight(this, this->unk1C_y, 2.0f);
|
||||
chbat_updateRollTowardsZero(this);
|
||||
}
|
||||
|
||||
if(actor_animationIsAt(this, 0.5f)){
|
||||
func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f);
|
||||
}
|
||||
break;
|
||||
case 6: //L80360BF4
|
||||
case CH_BAT_STATE_ENTER_ROOST:
|
||||
if(animctrl_getAnimTimer(this->animctrl) < 0.01){
|
||||
func_8035F970(this);
|
||||
chbat_roost(this);
|
||||
}
|
||||
break;
|
||||
case 7: //L80360C28
|
||||
case CH_BAT_STATE_FALL: //L80360C28
|
||||
sp34 = time_getDelta();
|
||||
func_8032CA80(this, this->unk38_0 ? 0x13 : 0x4);
|
||||
if(func_8035FC98(this, this->velocity_x * sp34)){
|
||||
this->position_y = mapModel_getFloorY(this->position);
|
||||
subaddie_set_state_with_direction(this, 8, 0.01f, 1);
|
||||
subaddie_set_state_with_direction(this, CH_BAT_STATE_DIE, 0.01f, 1);
|
||||
actor_playAnimationOnce(this);
|
||||
func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200);
|
||||
}
|
||||
@@ -489,7 +492,7 @@ void func_80360828(Actor *this){
|
||||
this->velocity_x -= 1600.0f * sp34;
|
||||
}
|
||||
break;
|
||||
case 8: //L80360CF0
|
||||
case CH_BAT_STATE_DIE: //L80360CF0
|
||||
if(actor_animationIsAt(this, 0.3f)){
|
||||
func_80326310(this);
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
void func_802D77D4(Actor *this);
|
||||
extern void func_8028F738(f32[3], f32[3], f32, u32);
|
||||
extern void player_setClimbParams(f32[3], f32[3], f32, u32);
|
||||
extern f32 func_80258640(f32[3], f32[3]);
|
||||
|
||||
typedef struct {
|
||||
@@ -78,7 +78,7 @@ void func_802D77D4(Actor *this) {
|
||||
if (((sp4C[0] * sp4C[0]) + (sp4C[2] * sp4C[2])) < (sp3C * sp3C)) {
|
||||
if ((this->position[1] < sp40[1]) && (sp40[1] <= local->unk0[1])) {
|
||||
if (volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME) == 0) {
|
||||
func_8028F738(this->position, local->unk0, (f32)this->unkF4_8, local->unkC);
|
||||
player_setClimbParams(this->position, local->unk0, (f32)this->unkF4_8, local->unkC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern bool func_80259254(f32[3], f32, f32, f32);
|
||||
extern bool ml_vec3f_point_within_horizontal_distance(f32[3], f32, f32, f32);
|
||||
|
||||
/* .data */
|
||||
ActorAnimationInfo chCrabAnimations[] ={
|
||||
@@ -185,7 +185,7 @@ void __chCrab_die(ActorMarker *marker, ActorMarker *other){
|
||||
this->unk138_27 = 1;
|
||||
marker_despawn(marker);
|
||||
if( map_get() == MAP_B_CC_CLANKERS_CAVERN
|
||||
&& func_80259254(this->position, 13778.0f, 0.0f, 3000.0f)
|
||||
&& ml_vec3f_point_within_horizontal_distance(this->position, 13778.0f, 0.0f, 3000.0f)
|
||||
) {
|
||||
this->depth_mode = MODEL_RENDER_DEPTH_COMPARE;
|
||||
if( !jiggyscore_isCollected(JIGGY_16_CC_SNIPPETS)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern int func_802592C4(f32[3], f32[3], f32);
|
||||
extern int ml_vec3f_within_horizontal_distance(f32[3], f32[3], f32);
|
||||
extern void func_802EFA20(ParticleEmitter *, f32, f32);
|
||||
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
|
||||
extern void func_80328FB0(Actor *, f32);
|
||||
@@ -198,7 +198,7 @@ int __chSnowman_CCW_playerInProtectedZone(void){
|
||||
f32 player_position[3];
|
||||
if(map_get() == MAP_46_CCW_WINTER){
|
||||
player_getPosition(player_position);
|
||||
if(func_802592C4(player_position, ccw_no_attack_zone, 900.0f))
|
||||
if(ml_vec3f_within_horizontal_distance(player_position, ccw_no_attack_zone, 900.0f))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -57,7 +57,7 @@ void __chTermite_updateWalkSFX(Actor *this) {
|
||||
f32 sp24[3];
|
||||
f32 sp20;
|
||||
|
||||
viewport_getPosition_vec3f(&sp24);
|
||||
viewport_getPosition_vec3f(sp24);
|
||||
sp20 = ml_map_f( (300.0f - sp24[0])*(300.0f - sp24[0]) + (this->position[1] - sp24[1])*(this->position[1] - sp24[1]) + (-858.0f - sp24[2])*(-858.0f - sp24[2])
|
||||
, 7617600.0f, 8236900.0f
|
||||
, 8000.0f, 1000.0f
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <core1/viewport.h>
|
||||
|
||||
|
||||
extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val);
|
||||
extern int ml_vec3f_point_within_horizontal_distance(f32 vec[3], f32 x, f32 z, f32 val);
|
||||
extern f32 player_getYaw(void);
|
||||
|
||||
/* .bss */
|
||||
@@ -179,7 +179,7 @@ int func_8028B094(void){
|
||||
int player_isInHorizontalRadius(f32 arg0[3], f32 arg1){
|
||||
f32 sp1C[3];
|
||||
_player_getPosition(sp1C);
|
||||
return func_80259254(sp1C, arg0[0], arg0[2], arg1);
|
||||
return ml_vec3f_point_within_horizontal_distance(sp1C, arg0[0], arg0[2], arg1);
|
||||
}
|
||||
|
||||
s32 func_8028B120(void){return 0;}
|
||||
|
@@ -420,8 +420,8 @@ int func_802E805C(BKCollisionList *collision_list, BKVertexList *vtxList, f32 ar
|
||||
else{
|
||||
mlMtxIdent();
|
||||
func_80252CC4(arg2, arg3, arg4, 0);
|
||||
func_8025235C(sp44, arg5);
|
||||
func_8025235C(sp38, arg6);
|
||||
mlMtx_apply_vec3f(sp44, arg5);
|
||||
mlMtx_apply_vec3f(sp38, arg6);
|
||||
sp34 = func_802E76B0(collision_list, vtxList, sp44, sp38, arg7, arg8);
|
||||
if(!sp34){
|
||||
return 0;
|
||||
@@ -429,17 +429,17 @@ int func_802E805C(BKCollisionList *collision_list, BKVertexList *vtxList, f32 ar
|
||||
else{
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg2, arg3, arg4, NULL);
|
||||
func_8025235C(arg6, sp38);
|
||||
mlMtx_apply_vec3f(arg6, sp38);
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252C08(NULL, arg3, 1.0f, 0);
|
||||
func_8025235C(arg7, arg7);
|
||||
mlMtx_apply_vec3f(arg7, arg7);
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg2, arg3, arg4, 0);
|
||||
|
||||
for(i = 0; i < 3; i++){
|
||||
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -750,22 +750,22 @@ s32 func_802E9118(BKCollisionList * collision_list, BKVertexList *vtx_list, f32
|
||||
}
|
||||
mlMtxIdent();
|
||||
func_80252CC4(arg2, arg3, arg4, 0);
|
||||
func_8025235C(&sp4C, arg5);
|
||||
func_8025235C(&sp40, arg6);
|
||||
mlMtx_apply_vec3f(&sp4C, arg5);
|
||||
mlMtx_apply_vec3f(&sp40, arg6);
|
||||
sp3C = func_802E8E88(collision_list, vtx_list, &sp4C, &sp40, arg7 / arg4, arg8, arg9, flagFilter);
|
||||
if (sp3C == 0) {
|
||||
return 0;
|
||||
}
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg2, arg3, arg4, 0);
|
||||
func_8025235C(arg6, &sp40);
|
||||
mlMtx_apply_vec3f(arg6, &sp40);
|
||||
mlMtxIdent();
|
||||
func_80252C08(NULL, arg3, 1.0f, 0);
|
||||
func_8025235C(arg8, arg8);
|
||||
mlMtx_apply_vec3f(arg8, arg8);
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg2, arg3, arg4, 0);
|
||||
for(i = 0; i < 3; i++){
|
||||
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
}
|
||||
return sp3C;
|
||||
}
|
||||
@@ -987,22 +987,22 @@ s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 pos
|
||||
}
|
||||
mlMtxIdent();
|
||||
func_80252CC4(posA, rotA, scaleA, NULL);
|
||||
func_8025235C(sp34, posB);
|
||||
mlMtx_apply_vec3f(sp34, posB);
|
||||
sp30 = func_802E92AC(collisionList, vtxList, &sp34, radB / scaleA, arg7, arg8);
|
||||
if (sp30 == 0) {
|
||||
return 0;
|
||||
}
|
||||
mlMtxIdent();
|
||||
func_80252C08(posA, rotA, scaleA, NULL);
|
||||
func_8025235C(posB, sp34);
|
||||
mlMtx_apply_vec3f(posB, sp34);
|
||||
mlMtxIdent();
|
||||
func_80252C08(NULL, rotA, 1.0f, NULL);
|
||||
func_8025235C(arg7, arg7);
|
||||
mlMtx_apply_vec3f(arg7, arg7);
|
||||
mlMtxIdent();
|
||||
func_80252C08(posA, rotA, scaleA, NULL);
|
||||
|
||||
for(i = 0; i < 3; i++){
|
||||
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
|
||||
}
|
||||
return sp30;
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ bool func_802EA760(BKModelUnk14List *arg0, s32 arg1, f32 arg2[3], f32 rotation[3
|
||||
*arg7 = (f32) temp_v0->unk0;
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg2, rotation, scale, arg5);
|
||||
func_8025235C(arg6, arg6);
|
||||
mlMtx_apply_vec3f(arg6, arg6);
|
||||
*arg7 /= scale;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ s32 func_802EA864(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
|
||||
mlMtxIdent();
|
||||
func_80252EC8(spB0, sp8C);
|
||||
func_80252CC4(position, rotation, scale, arg4);
|
||||
func_8025235C(sp78, arg5);
|
||||
mlMtx_apply_vec3f(sp78, arg5);
|
||||
for(j = 0; j < 3; j++){
|
||||
if (((sp78[j] + arg6 / scale) <= spA4[j]) || (sp98[j] <= (sp78[j] - arg6 / scale)))
|
||||
break;
|
||||
@@ -110,7 +110,7 @@ s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
|
||||
mlMtxIdent();
|
||||
func_80252DDC(spA0, sp94);
|
||||
func_80252CC4(position, rotation, scale, arg4);
|
||||
func_8025235C(sp78, arg5);
|
||||
mlMtx_apply_vec3f(sp78, arg5);
|
||||
if (!(temp_f20 / 2 <= (sp78[2] - arg6 / scale)) && !((sp78[2] + arg6 / scale) <= -(temp_f20 / 2))) {
|
||||
if (!(((arg6 / scale + temp_f24) * (arg6 / scale + temp_f24)) <= ((sp78[0] * sp78[0]) + (sp78[1] * sp78[1])))) {
|
||||
return iPtr->unkD;
|
||||
@@ -134,7 +134,7 @@ s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252CC4(position, rotation, scale, arg4);
|
||||
func_8025235C(sp5C, arg5);
|
||||
mlMtx_apply_vec3f(sp5C, arg5);
|
||||
t0_ptr = (BKModelUnk14_0 *)(arg0 + 1);
|
||||
t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0);
|
||||
i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2);
|
||||
@@ -328,7 +328,7 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252CC4(position, rotation, scale, arg4);
|
||||
func_8025235C(sp74, arg6);
|
||||
mlMtx_apply_vec3f(sp74, arg6);
|
||||
t0_ptr = (BKModelUnk14_0 *)(arg0 + 1);
|
||||
t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0);
|
||||
i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2);
|
||||
@@ -342,8 +342,8 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
|
||||
sp5C[1] = sp68[1];
|
||||
sp5C[2] = sp68[2];
|
||||
mlMtxSet(animMtxList_get(arg5, i_ptr->unk9));
|
||||
func_8025235C(sp68, sp68);
|
||||
func_8025235C(sp5C, sp5C);
|
||||
mlMtx_apply_vec3f(sp68, sp68);
|
||||
mlMtx_apply_vec3f(sp5C, sp5C);
|
||||
sp44[0] = sp5C[0] - sp68[0];
|
||||
sp44[1] = sp5C[1] - sp68[1];
|
||||
sp44[2] = sp5C[2] - sp68[2];
|
||||
@@ -449,7 +449,7 @@ s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
|
||||
mlMtxIdent();
|
||||
func_80252EC8(i_position, i_rotation); //derotate about point
|
||||
func_80252CC4(arg1, rotation, scale, arg4);
|
||||
func_8025235C(sp68, arg5); //apply matrix to arg5
|
||||
mlMtx_apply_vec3f(sp68, arg5); //apply matrix to arg5
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (1);
|
||||
@@ -496,7 +496,7 @@ s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
|
||||
mlMtxIdent();
|
||||
func_80252DDC(sp90, sp84);
|
||||
func_80252CC4(arg1, rotation, scale, arg4);
|
||||
func_8025235C(sp68, arg5);
|
||||
mlMtx_apply_vec3f(sp68, arg5);
|
||||
temp_f0 = (f32) (temp_f22 / 2.0);
|
||||
if (!(temp_f0 <= sp68[2]) && !(sp68[2] <= -temp_f0) && !((temp_f20 * temp_f20) <= (sp68[0] * sp68[0] + sp68[1]*sp68[1]))) {
|
||||
return i_ptr->unkD;
|
||||
@@ -523,7 +523,7 @@ s32 func_802EC238(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
|
||||
end_ptr = i_ptr + arg0->unk4;
|
||||
mlMtxIdent();
|
||||
func_80252CC4(arg1, rotation, scale, arg4);
|
||||
func_8025235C(sp54, arg5);
|
||||
mlMtx_apply_vec3f(sp54, arg5);
|
||||
for (i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++) {
|
||||
if ((i_ptr->unk8 != 0) && ((arg6 == 0) || (arg6 == i_ptr->unk8))) {
|
||||
sp40[0] = i_ptr->unk2[0];
|
||||
|
@@ -52,7 +52,7 @@ void vtxList_getBoundsMlMtxTransformed(BKVertexList *self, f32 min[3], f32 max[3
|
||||
min[0] = (f32) start_vtx->v.ob[0];
|
||||
min[1] = (f32) start_vtx->v.ob[1];
|
||||
min[2] = (f32) start_vtx->v.ob[2];
|
||||
func_8025235C(min, min);
|
||||
mlMtx_apply_vec3f(min, min);
|
||||
max[0] = min[0];
|
||||
max[1] = min[1];
|
||||
max[2] = min[2];
|
||||
@@ -61,7 +61,7 @@ void vtxList_getBoundsMlMtxTransformed(BKVertexList *self, f32 min[3], f32 max[3
|
||||
i_coord[0] = (f32) i_vtx->v.ob[0];
|
||||
i_coord[1] = (f32) i_vtx->v.ob[1];
|
||||
i_coord[2] = (f32) i_vtx->v.ob[2];
|
||||
func_8025235C(i_coord, i_coord);
|
||||
mlMtx_apply_vec3f(i_coord, i_coord);
|
||||
|
||||
for(i = 0; i < 3; i++){
|
||||
if( i_coord[i] < min[i]){
|
||||
@@ -88,7 +88,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
|
||||
i_coord[0] = (f32) i_vtx->v.ob[0];
|
||||
i_coord[1] = (f32) i_vtx->v.ob[1];
|
||||
i_coord[2] = (f32) i_vtx->v.ob[2];
|
||||
func_8025235C(i_coord, i_coord);
|
||||
mlMtx_apply_vec3f(i_coord, i_coord);
|
||||
if ((i_vtx == start_vtx) || (i_coord[1] < arg2[1])) {
|
||||
arg2[1] = i_coord[1];
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
|
||||
i_coord[0] = (f32) i_vtx->v.ob[0];
|
||||
i_coord[1] = (f32) i_vtx->v.ob[1];
|
||||
i_coord[2] = (f32) i_vtx->v.ob[2];
|
||||
func_8025235C(i_coord, i_coord);
|
||||
mlMtx_apply_vec3f(i_coord, i_coord);
|
||||
if (i_coord[1] < arg3[1]) {
|
||||
|
||||
arg2[0] = i_coord[0];
|
||||
@@ -116,7 +116,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
|
||||
i_coord[0] = (f32) i_vtx->v.ob[0];
|
||||
i_coord[1] = (f32) i_vtx->v.ob[1];
|
||||
i_coord[2] = (f32) i_vtx->v.ob[2];
|
||||
func_8025235C(i_coord, i_coord);
|
||||
mlMtx_apply_vec3f(i_coord, i_coord);
|
||||
if (i_coord[1] < arg3[1]) {
|
||||
for(i = 0; i < 3; i+=2){
|
||||
if (i_coord[i] < arg2[i]) {
|
||||
@@ -204,9 +204,18 @@ void vtxList_tint(BKVertexList *dst, s32 target_color[3], f32 amount, BKVertexLi
|
||||
osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx));
|
||||
}
|
||||
|
||||
void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotation[3], f32 arg4[4]) {
|
||||
f32 sp74[3];
|
||||
f32 sp68[3];
|
||||
/**
|
||||
* @note Seems Recolor vtx based on how "in view" a vtx is
|
||||
*
|
||||
* @param dst vertexList to recolor
|
||||
* @param src vertexList to tak colors from
|
||||
* @param position vertexlist world position
|
||||
* @param rotation vertexlist world rotation
|
||||
* @param arg4 Step function definition
|
||||
*/
|
||||
void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 position[3], f32 rotation[3], f32 arg4[4]) {
|
||||
f32 vp_position[3];
|
||||
f32 vp_look[3];
|
||||
Vtx *dst_vtx;
|
||||
Vtx *start_vtx;
|
||||
Vtx *end_vtx;
|
||||
@@ -216,23 +225,21 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotati
|
||||
f32 temp_f0;
|
||||
s32 pad40;
|
||||
|
||||
viewport_getPosition_vec3f(sp74);
|
||||
viewport_getLookVector(sp68);
|
||||
viewport_getPosition_vec3f(vp_position);
|
||||
viewport_getLookVector(vp_look);
|
||||
mlMtxIdent();
|
||||
func_80252CC4(arg2, rotation, 1.0f, NULL);
|
||||
func_8025235C(sp74, sp74);
|
||||
func_80252CC4(position, rotation, 1.0f, NULL);
|
||||
mlMtx_apply_vec3f(vp_position, vp_position);
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252CC4(NULL, rotation, 1.0f, NULL);
|
||||
func_8025235C(sp68, sp68);
|
||||
mlMtx_apply_vec3f(vp_look, vp_look);
|
||||
|
||||
start_vtx = (Vtx *)(dst + 1);
|
||||
end_vtx = start_vtx + dst->count;
|
||||
for(dst_vtx = start_vtx, src_vtx = (Vtx *)(src + 1); dst_vtx < end_vtx; dst_vtx++, src_vtx++){
|
||||
sp4C[0] = dst_vtx->v.ob[0] - sp74[0];
|
||||
sp4C[1] = dst_vtx->v.ob[1] - sp74[1];
|
||||
sp4C[2] = dst_vtx->v.ob[2] - sp74[2];
|
||||
temp_f0 = sp68[0]*sp4C[0] + sp68[1]*sp4C[1] + sp68[2]*sp4C[2];
|
||||
TUPLE_DIFF_COPY(sp4C, dst_vtx->v.ob, vp_position);
|
||||
temp_f0 = TUPLE_DOT_PRODUCT(vp_look, sp4C);
|
||||
temp_f0 = func_8034A9D0(arg4, temp_f0);
|
||||
for(i = 0; i < 3; i++){
|
||||
dst_vtx->v.cn[i] = temp_f0*src_vtx->v.cn[i];
|
||||
@@ -333,8 +340,8 @@ void func_802ED180(BKVertexList *self, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a
|
||||
|
||||
mlMtxIdent();
|
||||
func_80252CC4(arg1, arg2, arg3, arg4);
|
||||
func_8025235C(sp88, D_803808C0.unk10);
|
||||
func_8025235C(sp7C, D_803808C0.unk4);
|
||||
mlMtx_apply_vec3f(sp88, D_803808C0.unk10);
|
||||
mlMtx_apply_vec3f(sp7C, D_803808C0.unk4);
|
||||
temp_f20 = D_803808C0.unk1C / arg3;
|
||||
temp_f20 = temp_f20*temp_f20;
|
||||
start = (Vtx*)(self + 1);
|
||||
@@ -353,7 +360,7 @@ void func_802ED180(BKVertexList *self, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a
|
||||
D_803808C0.unk0 = 1;
|
||||
mlMtxIdent();
|
||||
func_80252C08(arg1, arg2, arg3, arg4);
|
||||
func_8025235C(D_803808C0.unk20, sp70);
|
||||
mlMtx_apply_vec3f(D_803808C0.unk20, sp70);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
|
||||
spBC = (s32) ((f32)self->unk20 * (1.0f + temp_f2));
|
||||
temp_s5 = (s32) ((f32)self->unk20 * ((1.0f - (self->unk25 / 255.0f)) + ((self->unk25 / 255.0f) - temp_f2)));
|
||||
mlMtxSet(&D_80380A18);
|
||||
func_8025235C(spD0, spD0);
|
||||
mlMtx_apply_vec3f(spD0, spD0);
|
||||
spD0[0] = (-297.0f * spD0[0]) / spD0[2];
|
||||
spD0[1] = (297.0f * spD0[1]) / spD0[2];
|
||||
spC4 = (s32) (spD0[0] + (f32) (framebuffer_width / 2));
|
||||
|
@@ -22,7 +22,7 @@ extern void func_8029B73C(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
||||
bool func_8028F4B8(f32 arg0[3], f32 arg1, f32 arg2);
|
||||
bool func_8028F620(f32 arg0[3], f32 arg1, f32 arg2);
|
||||
void func_8028F85C(f32 arg0[3]);
|
||||
void func_8028F8A4(f32 rotation[3]);
|
||||
void player_setRotation(f32 rotation[3]);
|
||||
void func_8028F918(s32 arg0);
|
||||
|
||||
|
||||
@@ -46,15 +46,15 @@ f32 D_8037BFCC;
|
||||
f32 D_8037BFD0;
|
||||
|
||||
/* .code */
|
||||
bool func_8028DFF0(s32 arg0, s32 arg1[3]) {
|
||||
bool func_8028DFF0(s32 arg0, s32 position[3]) {
|
||||
if (arg0 >= 0x80) {
|
||||
arg1[0] = func_802E4A98(arg0);
|
||||
arg1[1] = func_802E4AAC(arg0);
|
||||
arg1[2] = func_802E4AC0(arg0);
|
||||
position[0] = func_802E4A98(arg0);
|
||||
position[1] = func_802E4AAC(arg0);
|
||||
position[2] = func_802E4AC0(arg0);
|
||||
return TRUE;
|
||||
}
|
||||
else{
|
||||
return _nodeProp_findPositionFromActorId(func_803084F0(arg0), arg1);
|
||||
return _nodeProp_findPositionFromActorId(func_803084F0(arg0), position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ void func_8028E0F0(s32 arg0, s32 arg1[3]) {
|
||||
bs_setState(badrone_goto(sp7C, 1.0f, func_8028E0B0, NULL));
|
||||
return;
|
||||
}
|
||||
func_8028F85C(&sp7C);
|
||||
func_8028F85C(sp7C);
|
||||
func_80295A8C();
|
||||
bsStoredState_setTrot(FALSE);
|
||||
miscFlag_clear(MISC_FLAG_16);
|
||||
@@ -192,7 +192,7 @@ void func_8028E4B0(void) {
|
||||
return;
|
||||
}
|
||||
if (sp20 == 0x63) {
|
||||
func_8028F85C(&D_8037BFC0);
|
||||
func_8028F85C(D_8037BFC0);
|
||||
yaw_set(D_8037BFCC);
|
||||
D_8037BFBC = (s32) D_8037BFD0;
|
||||
D_8037BFB8 = 1;
|
||||
@@ -213,12 +213,12 @@ void func_8028E4B0(void) {
|
||||
D_80363694--;
|
||||
if (D_80363694 == 0) {
|
||||
func_8028F85C(D_80363698);
|
||||
func_8028F8A4(D_803636A4);
|
||||
player_setRotation(D_803636A4);
|
||||
}
|
||||
}
|
||||
if (D_803636B0) {
|
||||
D_803636B0 = FALSE;
|
||||
func_8028F85C(&D_803636B4);
|
||||
func_8028F85C(D_803636B4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@ bool player_setCarryObjectPoseInHorizontalRadius(f32 position[3], f32 radius, en
|
||||
}
|
||||
|
||||
//sets carry actor if player is within a cylinder around a point
|
||||
bool func_8028F364(f32 position[3], f32 radius, f32 vert_range, enum actor_e actor_id, Actor **arg4) {
|
||||
bool player_setCarryObjectPoseInCylinder(f32 position[3], f32 radius, f32 vert_range, enum actor_e actor_id, Actor **arg4) {
|
||||
if (player_isInVerticalRange(position, vert_range)) {
|
||||
return player_setCarryObjectPoseInHorizontalRadius(position, radius, actor_id, arg4);
|
||||
}
|
||||
@@ -774,7 +774,7 @@ void player_stateTimer_set(enum state_timer_e timer_id, f32 value){
|
||||
stateTimer_set(timer_id, value);
|
||||
}
|
||||
|
||||
void func_8028F738(f32 bottom[3], f32 top[3], f32 radius, u32 arg3){
|
||||
void player_setClimbParams(f32 bottom[3], f32 top[3], f32 radius, u32 arg3){
|
||||
climbSet(bottom, top, radius, arg3);
|
||||
}
|
||||
|
||||
@@ -824,7 +824,7 @@ void func_8028F85C(f32 arg0[3]){
|
||||
cameraMode_update();
|
||||
}
|
||||
|
||||
void func_8028F8A4(f32 rotation[3]){
|
||||
void player_setRotation(f32 rotation[3]){
|
||||
pitch_setIdeal(rotation[0]);
|
||||
yaw_setIdeal(rotation[1]);
|
||||
roll_setIdeal(rotation[2]);
|
||||
@@ -875,8 +875,8 @@ void func_8028FA34(enum actor_e arg0, Actor *arg1){
|
||||
func_8028DEEC(arg0, arg1);
|
||||
}
|
||||
|
||||
void func_8028FA54(f32 arg0[3]){
|
||||
set_throw_target_position(arg0);
|
||||
void player_setThrowTargetPosition(f32 position[3]){
|
||||
set_throw_target_position(position);
|
||||
}
|
||||
|
||||
void func_8028FA74(f32 dst[3]){
|
||||
@@ -897,7 +897,7 @@ void func_8028FAB0(f32 arg0[3]){
|
||||
func_80298564(diff);
|
||||
}
|
||||
|
||||
void func_8028FAEC(f32 rotation[3]){
|
||||
void player_setIdealRotation(f32 rotation[3]){
|
||||
pitch_setIdeal(rotation[0]);
|
||||
yaw_setIdeal(rotation[1]);
|
||||
roll_setIdeal(rotation[2]);
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <core1/viewport.h>
|
||||
|
||||
#define _SQ3(x, y, z) (((x) * (x)) + ((y) * (y)) + ((z) * (z)))
|
||||
#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
|
||||
|
||||
/*.code*/
|
||||
void func_802F87B0(struct6s *this){
|
||||
@@ -28,8 +27,7 @@ void func_802F87B0(struct6s *this){
|
||||
sp4C[1] = randf2(200.0f, 500.0f);
|
||||
sp4C[2] = -f20;
|
||||
|
||||
if(gu_sqrtf(_SQ3v1((&this->unkC))) < 5.0f)
|
||||
{
|
||||
if (LENGTH_VEC3F((&this->unkC)) < 5.0f) {
|
||||
ml_vec3f_yaw_rotate_copy(sp4C, sp4C, randf2(0.0f, 360.0f));
|
||||
}
|
||||
else{
|
||||
|
@@ -231,7 +231,7 @@ bool func_802F989C(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
|
||||
) {
|
||||
func_80251B5C(D_80381070[0], D_80381070[1], D_80381070[2]);
|
||||
mlMtxApply(*mtx);
|
||||
func_80252434(&D_80381080, D_80381094->unkC);
|
||||
mlMtx_apply_vec3f_restricted(&D_80381080, D_80381094->unkC);
|
||||
func_80251B5C(D_80381080[0], D_80381080[1], D_80381080[2]);
|
||||
mlMtx_rotate_yaw_deg(D_80381060[1]);
|
||||
mlMtx_rotate_pitch_deg(D_80381060[0]);
|
||||
|
@@ -1759,7 +1759,7 @@ s32 func_80306EF4(s32 arg0[3], s32 arg1, u32 arg2) {
|
||||
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->count; var_s0++){
|
||||
if( (var_s0->unk10_3 & arg2)
|
||||
&& (temp_s4 >= var_s0->position[1]) && (temp_s6 < var_s0->position[1])
|
||||
&& (func_80259328(arg0, (void *) var_s0, var_s0->radius))
|
||||
&& (ml_vec3w_within_horizontal_distance(arg0, (void *) var_s0, var_s0->radius))
|
||||
) {
|
||||
return var_s1 - D_8036A9C8;
|
||||
}
|
||||
@@ -1769,7 +1769,7 @@ s32 func_80306EF4(s32 arg0[3], s32 arg1, u32 arg2) {
|
||||
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->count; var_s0++){
|
||||
if( (var_s0->unk10_3 & arg2)
|
||||
&& ((var_s0->unk10_3 & 2) || ((temp_s4 >= var_s0->position[1]) && (temp_s6 < var_s0->position[1])))
|
||||
&& (func_80259328(arg0, (void *) var_s0, var_s0->radius))
|
||||
&& (ml_vec3w_within_horizontal_distance(arg0, (void *) var_s0, var_s0->radius))
|
||||
) {
|
||||
return var_s1 - D_8036A9C8;
|
||||
}
|
||||
@@ -1865,7 +1865,7 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
if (arg4 & 1) {
|
||||
if (var_s0->unk10_3 & arg4) {
|
||||
if (!(max < var_s0->position[1]) && (min < var_s0->position[1])) {
|
||||
if (func_80259328(sp4C, var_s0->position, var_s0->radius)) {
|
||||
if (ml_vec3w_within_horizontal_distance(sp4C, var_s0->position, var_s0->radius)) {
|
||||
return arg2;
|
||||
}
|
||||
}
|
||||
@@ -1874,7 +1874,7 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
else{
|
||||
if( (var_s0->unk10_3 & arg4))
|
||||
if( ((var_s0->unk10_3 & 2) || (!(max < var_s0->position[1]) && (min < var_s0->position[1]))))
|
||||
if( func_80259328(&sp4C, var_s0->position, var_s0->radius))
|
||||
if (ml_vec3w_within_horizontal_distance(&sp4C, var_s0->position, var_s0->radius))
|
||||
return arg2;
|
||||
}
|
||||
|
||||
@@ -1882,7 +1882,7 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->count; var_s0++){
|
||||
if (var_s0->unk10_3 & arg4)
|
||||
if (!(max < var_s0->position[1]) && (min < var_s0->position[1]))
|
||||
if(func_80259328(&sp4C, var_s0, var_s0->radius))
|
||||
if (ml_vec3w_within_horizontal_distance(&sp4C, var_s0, var_s0->radius))
|
||||
return (var_s0 - temp_s1->unk8);
|
||||
}
|
||||
}
|
||||
@@ -1890,7 +1890,7 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->count; var_s0++){
|
||||
if ((var_s0->unk10_3 & arg4))
|
||||
if(((var_s0->unk10_3 & 2) || (!(max < var_s0->position[1]) && (min < var_s0->position[1]))))
|
||||
if(func_80259328(&sp4C, var_s0, var_s0->radius))
|
||||
if (ml_vec3w_within_horizontal_distance(&sp4C, var_s0, var_s0->radius))
|
||||
return var_s0 - temp_s1->unk8;
|
||||
}
|
||||
}
|
||||
|
@@ -219,8 +219,8 @@ s32 func_8030CDE4(SfxSource *arg0){
|
||||
f32 temp_f0;
|
||||
f32 pad;
|
||||
|
||||
viewport_getPosition_vec3f(&sp44);
|
||||
viewport_getLookVector(&sp38);
|
||||
viewport_getPosition_vec3f(sp44);
|
||||
viewport_getLookVector(sp38);
|
||||
sp2C[0] = arg0->position[0] - sp44[0];
|
||||
sp2C[1] = arg0->position[1] - sp44[1];
|
||||
sp2C[2] = arg0->position[2] - sp44[2];
|
||||
@@ -228,9 +228,9 @@ s32 func_8030CDE4(SfxSource *arg0){
|
||||
if(sp2C[0]*sp2C[0] + sp2C[1]*sp2C[1] + sp2C[2]*sp2C[2] < 10.0f){
|
||||
return 0x40;
|
||||
}
|
||||
ml_vec3f_normalize(&sp2C);
|
||||
ml_vec3f_normalize(sp2C);
|
||||
sp38[1] = 0.0f;
|
||||
ml_vec3f_normalize(&sp38);
|
||||
ml_vec3f_normalize(sp38);
|
||||
temp_f0 = func_80256AB4(sp38[0], sp38[2], sp2C[0], sp2C[2]);
|
||||
if(arg0->unk16){
|
||||
arg0->unk18 += 0.07*((f32)(s32)(64.0f - (temp_f0 * 63.0f)) - arg0->unk18);
|
||||
|
@@ -1,74 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
/* .bss */
|
||||
u8 D_8037BFE0;
|
||||
f32 D_8037BFE4;
|
||||
f32 D_8037BFE8[5];
|
||||
|
||||
/* .code */
|
||||
s32 func_8028FD30(void) {
|
||||
s32 i;
|
||||
s32 cnt;
|
||||
|
||||
cnt = 0;
|
||||
for(i = 0; i < 5; i++){
|
||||
if(D_8037BFE8[i] != 0.0f){
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
bool func_8028FDC8(f32 arg0) {
|
||||
s32 i;
|
||||
|
||||
for(i = 0; i < 5; i++){
|
||||
if(arg0 - 0.25 < D_8037BFE8[i]){
|
||||
D_8037BFE4 = arg0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
for(i = 0; i < 5; i++){
|
||||
if (D_8037BFE8[i] == 0.0f) {
|
||||
D_8037BFE8[i] = arg0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
D_8037BFE4 = arg0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void func_8028FEF0(void) {
|
||||
s32 i;
|
||||
|
||||
for(i = 0; i < 5; i++){
|
||||
D_8037BFE8[i] = 0.0f;
|
||||
}
|
||||
D_8037BFE0 = D_8037BFE4 = 0.0f;
|
||||
}
|
||||
|
||||
void func_8028FFBC(bool arg0){
|
||||
D_8037BFE0 = arg0;
|
||||
if(!D_8037BFE0){
|
||||
func_8028FEF0();
|
||||
}
|
||||
}
|
||||
|
||||
void func_8028FFF0(void) {
|
||||
f32 temp_f0;
|
||||
s32 i;
|
||||
|
||||
if (D_8037BFE0 != 0) {
|
||||
for(i = 0; i < 5; i++){
|
||||
func_80259430(&D_8037BFE8[i]);
|
||||
}
|
||||
if (D_8037BFE4 != 0.0f) {
|
||||
temp_f0 = D_8037BFE4;
|
||||
D_8037BFE4 = 0.0f;
|
||||
func_8028FDC8(temp_f0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -163,7 +163,7 @@ void chMinigame_update(Actor *this){
|
||||
marker_setFreeMethod(this->marker, __chMinigame_free);
|
||||
func_8028FAB0(this->position);
|
||||
this->unk1C[0] = 0.0f; this->unk1C[1] = this->yaw; this->unk1C[2] = 0.0f;
|
||||
func_8028FAEC(this->unk1C);
|
||||
player_setIdealRotation(this->unk1C);
|
||||
this->has_met_before = FALSE;
|
||||
if(this->unk10_12 >= 7){
|
||||
marker_despawn(this->marker);
|
||||
|
@@ -45,7 +45,7 @@ void func_80323238(void){}
|
||||
|
||||
// =============================================BREAK ???
|
||||
|
||||
extern f32 func_80258708(f32 [3], f32[3]);
|
||||
extern f32 ml_vec3f_length(f32 [3], f32[3]);
|
||||
extern f32 ml_distanceSquared_vec3f(f32 [3], f32 [3]);
|
||||
extern void func_80341180(f32, s32, s32, f32 *, f32 [3]);
|
||||
|
||||
@@ -74,11 +74,11 @@ f32 func_803232AC(f32 *arg0, f32 arg1, f32 arg2, s32 arg3, f32 arg4) {
|
||||
while(var_f20 + arg4 < arg2){
|
||||
var_f20 += arg4;
|
||||
func_80341180(var_f20, arg3, 3, arg0, sp60);
|
||||
var_f22 += func_80258708(sp6C, sp60);
|
||||
var_f22 += ml_vec3f_length(sp6C, sp60);
|
||||
ml_vec3f_copy(sp6C, sp60);
|
||||
}
|
||||
func_80341180(arg2, arg3, 3, arg0, sp60);
|
||||
var_f22 += func_80258708(sp6C, sp60);
|
||||
var_f22 += ml_vec3f_length(sp6C, sp60);
|
||||
return var_f22;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ f32 func_80323A48(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
if (arg4 == 1.0) {
|
||||
var_f24 = arg4;
|
||||
func_80341180(var_f24, arg1, 3, arg0, spDC);
|
||||
var_f22 = var_f26 + func_80258708(spF4, spDC);
|
||||
var_f22 = var_f26 + ml_vec3f_length(spF4, spDC);
|
||||
} else {
|
||||
var_f24 += arg4;
|
||||
var_f24 = var_f24 - (s32)var_f24;
|
||||
@@ -210,17 +210,17 @@ f32 func_80323A48(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
}
|
||||
} else {
|
||||
func_80341180(var_f24, arg1, 3, arg0, spDC);
|
||||
var_f22 = var_f26 + func_80258708(spF4, spDC);
|
||||
var_f22 = var_f26 + ml_vec3f_length(spF4, spDC);
|
||||
}
|
||||
} else {
|
||||
if (arg4 == 1.0) {
|
||||
if (var_f24 < 0.0) {
|
||||
var_f24 = 0;
|
||||
func_80341180(var_f24, arg1, 3, arg0, &spDC);
|
||||
var_f22 = var_f26 + func_80258708(&spF4, &spDC);
|
||||
var_f22 = var_f26 + ml_vec3f_length(&spF4, &spDC);
|
||||
} else {
|
||||
func_80341180(var_f24, arg1, 3, arg0, &spDC);
|
||||
var_f22 = var_f26 + func_80258708(&spF4, &spDC);
|
||||
var_f22 = var_f26 + ml_vec3f_length(&spF4, &spDC);
|
||||
}
|
||||
} else if (var_f24 < arg4) {
|
||||
var_f24 -= arg4;
|
||||
@@ -235,7 +235,7 @@ f32 func_80323A48(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
var_f22 = var_f26 + gu_sqrtf(spD0[0]*spD0[0] + spD0[1]*spD0[1] + spD0[2]*spD0[2]);
|
||||
} else {
|
||||
func_80341180(var_f24, arg1, 3, arg0, &spDC);
|
||||
var_f22 = var_f26 + func_80258708(&spF4, &spDC);
|
||||
var_f22 = var_f26 + ml_vec3f_length(&spF4, &spDC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,8 +8,8 @@
|
||||
|
||||
#define DIST_SQ_VEC3F(v1, v2) ((v1[0] - v2[0])*(v1[0] - v2[0]) + (v1[1] - v2[1])*(v1[1] - v2[1]) + (v1[2] - v2[2])*(v1[2] - v2[2]))
|
||||
|
||||
extern f32 func_80258708(f32[3], f32[3]);
|
||||
extern bool func_80259384(f32[3], f32[3], f32);
|
||||
extern f32 ml_vec3f_length(f32[3], f32[3]);
|
||||
extern bool ml_vec3f_within_distance(f32[3], f32[3], f32);
|
||||
extern void func_802D7124(Actor *, f32);
|
||||
extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
|
||||
|
||||
@@ -661,7 +661,7 @@ Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e acto
|
||||
&& (i_actor->modelCacheIndex != 0x108)
|
||||
&& !i_actor->despawn_flag
|
||||
) {
|
||||
i_dist = func_80258708(position, i_actor->position);
|
||||
i_dist = ml_vec3f_length(position, i_actor->position);
|
||||
if (i_dist < min_dist) {
|
||||
min_dist = i_dist;
|
||||
closest_actor = i_actor;
|
||||
@@ -736,7 +736,7 @@ bool func_803270B8(f32 arg0[3], f32 arg1, enum marker_collision_func_type_e arg2
|
||||
if( !i_ptr->despawn_flag
|
||||
&& i_ptr->marker->collidable
|
||||
&& ((arg3 == NULL) || arg3(i_ptr))
|
||||
&& func_80259384(i_ptr->position, arg0, arg1)
|
||||
&& ml_vec3f_within_distance(i_ptr->position, arg0, arg1)
|
||||
) {
|
||||
if (i_ptr->marker->unk58 == NULL || i_ptr->marker->unk58(i_ptr->marker, arg4)
|
||||
) {
|
||||
|
@@ -45,7 +45,7 @@ extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32 arg3[
|
||||
iPtr = start_ptr;
|
||||
for(; iPtr < end_ptr && D_80383570.unk44 < D_80383570.unk48; iPtr++){
|
||||
if(iPtr->unk34 && ml_distance_vec3f(position, iPtr->unk0) < iPtr->unk1C + arg4){
|
||||
func_8025235C(iPtr->unkC, iPtr->unk0);
|
||||
mlMtx_apply_vec3f(iPtr->unkC, iPtr->unk0);
|
||||
iPtr->unk20 = iPtr->unk18/scale;
|
||||
iPtr->unk24 = iPtr->unk1C/scale;
|
||||
*D_80383570.unk44 = iPtr;
|
||||
|
@@ -40,7 +40,7 @@ bool func_80340020(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32
|
||||
arg7[2] = sp34[0][2] + (self->unk0 * sp6C[2]) + (self->unk4*sp60[2]);
|
||||
mlMtxIdent();
|
||||
func_80252C08(position, arg2, arg3, arg4);
|
||||
func_8025235C(arg7, arg7);
|
||||
mlMtx_apply_vec3f(arg7, arg7);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void func_80340200(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32
|
||||
self->unk8[2] = arg7[2];
|
||||
mlMtxIdent();
|
||||
func_80252CC4(position, arg2, arg3, arg4);
|
||||
func_8025235C(sp94, arg7);
|
||||
mlMtx_apply_vec3f(sp94, arg7);
|
||||
for(j = 0; j < 3; j++){
|
||||
self->unk14[j] = arg5[j];
|
||||
}
|
||||
|
@@ -3,6 +3,14 @@
|
||||
#include "variables.h"
|
||||
|
||||
/* .code */
|
||||
/*
|
||||
1.0| ,----.
|
||||
| / \
|
||||
| / \
|
||||
0.0|______/ \_____ arg1
|
||||
| | | |
|
||||
[2] [3] [0] [1]
|
||||
*/
|
||||
f32 func_8034A9D0(f32 arg0[4], f32 arg1) {
|
||||
if (arg0[1] <= arg1) {
|
||||
return 0.0f;
|
||||
|
@@ -55,7 +55,7 @@ void func_8034F774(void){
|
||||
sfxsource_setSfxId(D_803720A0.sfxsourceIdx, 0x3EC);
|
||||
func_8030DD14(D_803720A0.sfxsourceIdx, 3);
|
||||
func_8030DFF0(D_803720A0.sfxsourceIdx, 1);
|
||||
sfxsource_set_position(D_803720A0.sfxsourceIdx, &sp44);
|
||||
sfxsource_set_position(D_803720A0.sfxsourceIdx, sp44);
|
||||
sfxsource_set_fade_distances(D_803720A0.sfxsourceIdx, 400.0f, 3200.0f);
|
||||
func_8030DE44(D_803720A0.sfxsourceIdx, 2, 0.5f);
|
||||
func_8030E2C4(D_803720A0.sfxsourceIdx);
|
||||
|
@@ -451,7 +451,7 @@ void func_80351C48(void) {
|
||||
player_getPosition(sp4C);
|
||||
mlMtxIdent();
|
||||
func_80252CC4(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, 0);
|
||||
func_8025235C(D_80386180.unk14, sp4C);
|
||||
mlMtx_apply_vec3f(D_80386180.unk14, sp4C);
|
||||
if (func_8029FC4C() != 0) {
|
||||
D_80386180.unk0 = D_80386180.unk2C;
|
||||
} else {
|
||||
@@ -470,7 +470,7 @@ void func_80351C48(void) {
|
||||
if (D_80386180.unk2C != NULL) {
|
||||
mlMtxIdent();
|
||||
func_80252C08(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, NULL);
|
||||
func_8025235C(&sp4C, &D_80386180.unk14);
|
||||
mlMtx_apply_vec3f(&sp4C, &D_80386180.unk14);
|
||||
func_8028FAB0(&sp4C);
|
||||
}
|
||||
D_80386180.unk2C = NULL;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern f32 func_80258780(f32[3], f32[3]);
|
||||
extern f32 ml_vec3f_length_sq(f32[3], f32[3]);
|
||||
|
||||
typedef struct{
|
||||
f32 unk0;
|
||||
@@ -67,7 +67,7 @@ void func_80352114(Struct_core2_CB050_0 *arg0, s32 arg1, f32 arg2) {
|
||||
player_getPosition(player_position);
|
||||
if( (func_80294660() == 0x100)
|
||||
&& func_8028F20C()
|
||||
&& (func_80258780(player_position, arg0->unk4C) < 50000.0f)
|
||||
&& (ml_vec3f_length_sq(player_position, arg0->unk4C) < 50000.0f)
|
||||
) {
|
||||
sp58 = arg0->unk4C[0] - player_position[0];
|
||||
sp54 = arg0->unk4C[2] - player_position[2];
|
||||
|
@@ -710,7 +710,7 @@ void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){
|
||||
f32 sp30[3];
|
||||
|
||||
if(cmd->unk8){
|
||||
func_8025235C(sp30, cmd->unkC);
|
||||
mlMtx_apply_vec3f(sp30, cmd->unkC);
|
||||
mlMtx_push_translation(sp30[0], sp30[1], sp30[2]);
|
||||
mlMtxRotYaw(modelRenderCameraRotation[1]);
|
||||
if(!cmd->unkA){
|
||||
@@ -732,8 +732,8 @@ void func_803385BC(Gfx **gfx, Mtx **mtx, void *arg2){
|
||||
f32 f14;
|
||||
s32 tmp_v0;
|
||||
|
||||
func_8025235C(D_80383C78, cmd->unk8);
|
||||
func_8025235C(D_80383C88, cmd->unk14);
|
||||
mlMtx_apply_vec3f(D_80383C78, cmd->unk8);
|
||||
mlMtx_apply_vec3f(D_80383C88, cmd->unk14);
|
||||
|
||||
D_80383C68[0] = D_80383C88[0] - D_80383C78[0];
|
||||
D_80383C68[1] = D_80383C88[1] - D_80383C78[1];
|
||||
@@ -857,7 +857,7 @@ void func_80338B50(Gfx **gfx, Mtx **mtx, void *arg2){
|
||||
f32 dist;
|
||||
|
||||
if(cmd->subgeo_offset_1C){
|
||||
func_8025235C(D_80383C98, cmd->unk10);
|
||||
mlMtx_apply_vec3f(D_80383C98, cmd->unk10);
|
||||
dist = gu_sqrtf(D_80383C98[0]*D_80383C98[0] + D_80383C98[1]*D_80383C98[1] + D_80383C98[2]*D_80383C98[2]);
|
||||
if(cmd->min_C < dist && dist <= cmd->max_8){
|
||||
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->subgeo_offset_1C));
|
||||
@@ -873,11 +873,11 @@ void func_80338BFC(Gfx **gfx, Mtx **mtx, void *arg2){
|
||||
if(D_80383650){
|
||||
if(D_8038371C){
|
||||
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unkA));
|
||||
func_8025235C(sp20, cmd->unkC);
|
||||
mlMtx_apply_vec3f(sp20, cmd->unkC);
|
||||
mlMtxPop();
|
||||
}
|
||||
else{
|
||||
func_8025235C(sp20, cmd->unkC);
|
||||
mlMtx_apply_vec3f(sp20, cmd->unkC);
|
||||
}
|
||||
sp20[0] += modelRenderCameraPosition[0];
|
||||
sp20[1] += modelRenderCameraPosition[1];
|
||||
@@ -968,11 +968,11 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
|
||||
sp30 = (f32)cmd->unkE*modelRenderScale;
|
||||
if(D_8038371C){
|
||||
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk12));
|
||||
func_8025235C(sp34, sp34);
|
||||
mlMtx_apply_vec3f(sp34, sp34);
|
||||
mlMtxPop();
|
||||
}
|
||||
else{
|
||||
func_8025235C(sp34, sp34);
|
||||
mlMtx_apply_vec3f(sp34, sp34);
|
||||
}
|
||||
|
||||
sp34[0] += modelRenderCameraPosition[0];
|
||||
|
@@ -7,7 +7,7 @@
|
||||
extern bool func_80245314(f32[3], f32[3], f32, f32, u32);
|
||||
extern int func_80244D94(f32[3], f32[3], f32[3], u32, f32);
|
||||
extern int func_8024575C(f32[3], f32[3], f32, f32[3], s32, u32);
|
||||
extern f32 func_80258708(f32[3], f32[3]);
|
||||
extern f32 ml_vec3f_length(f32[3], f32[3]);
|
||||
extern f32 func_80259198(f32, f32);
|
||||
extern f32 func_8028E82C(void);
|
||||
extern f32 player_getYaw(void);
|
||||
@@ -102,7 +102,7 @@ bool func_802BC640(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3) {
|
||||
ml_vec3f_add(sp78, arg0, sp9C);
|
||||
func_80244D94(arg0, sp78, sp88, 0x9E0000, 40.0f);
|
||||
func_8024575C(arg0, sp78, 40.0f, sp88, 4, 0x9E0000);
|
||||
if (phi_f26 < func_80258708(arg0, sp78)) {
|
||||
if (phi_f26 < ml_vec3f_length(arg0, sp78)) {
|
||||
ncDynamicCamera_setPosition(sp78);
|
||||
ml_vec3f_clear(D_8037D9C8);
|
||||
ml_vec3f_clear(D_8037D9E0);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#define SNACKER_BB_DIALOG_0 VER_SELECT(0xe26, 0xa68, 0, 0)
|
||||
#define SNACKER_BB_DIALOG_1 VER_SELECT(0xe33, 0xa75, 0, 0)
|
||||
|
||||
s32 func_80259254(f32 *, f32, f32, f32);
|
||||
s32 ml_vec3f_point_within_horizontal_distance(f32 *, f32, f32, f32);
|
||||
void ncFirstPersonCamera_getZoomedInRotation(f32 *);
|
||||
|
||||
extern u8 D_8037DCCA;
|
||||
@@ -34,7 +34,7 @@ static s32 __snackerctl_player_within_distance(f32 x, f32 z, f32 dist){
|
||||
f32 player_position[3];
|
||||
|
||||
_player_getPosition(player_position);
|
||||
return func_80259254(player_position, x, z, dist);
|
||||
return ml_vec3f_point_within_horizontal_distance(player_position, x, z, dist);
|
||||
}
|
||||
|
||||
static SnackerCtlState __snackerctl_update_ttc(void){
|
||||
|
@@ -149,7 +149,7 @@ extern ActorInfo D_80372EE0;
|
||||
extern ActorInfo chTermite; //ticker
|
||||
extern ActorInfo D_80372FC0;
|
||||
extern ActorInfo D_80372FE4;
|
||||
extern ActorInfo D_803730D8; //nibbly
|
||||
extern ActorInfo gChBat; //nibbly
|
||||
extern ActorInfo D_80373100;
|
||||
extern ActorInfo D_80373134;
|
||||
extern ActorInfo D_80373158;
|
||||
@@ -335,7 +335,7 @@ void spawnQueue_reset(void){
|
||||
spawnableActorList_addIfMapVisited(&D_80372C18, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_12 | ACTOR_FLAG_UNKNOWN_17, MAP_1B_MMM_MAD_MONSTER_MANSION); //teehee
|
||||
spawnableActorList_addIfMapVisited(&D_80372FC0, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_16 | ACTOR_FLAG_UNKNOWN_25, MAP_1B_MMM_MAD_MONSTER_MANSION);
|
||||
spawnableActorList_addIfMapVisited(&D_80372FE4, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_10 | ACTOR_FLAG_UNKNOWN_16 | ACTOR_FLAG_UNKNOWN_25, MAP_1B_MMM_MAD_MONSTER_MANSION);
|
||||
spawnableActorList_addIfMapVisited(&D_803730D8, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_21 |ACTOR_FLAG_UNKNOWN_25, MAP_1B_MMM_MAD_MONSTER_MANSION); //nibbly
|
||||
spawnableActorList_addIfMapVisited(&gChBat, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_21 |ACTOR_FLAG_UNKNOWN_25, MAP_1B_MMM_MAD_MONSTER_MANSION); //nibbly
|
||||
spawnableActorList_addIfMapVisited(&D_80367130, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_3 | ACTOR_FLAG_UNKNOWN_5 | ACTOR_FLAG_UNKNOWN_7 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_11 | ACTOR_FLAG_UNKNOWN_25, MAP_D_BGS_BUBBLEGLOOP_SWAMP); //buzzbomb
|
||||
spawnableActorList_addIfMapVisited(&D_80372B80, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_6 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_17 | ACTOR_FLAG_UNKNOWN_25, MAP_27_FP_FREEZEEZY_PEAK);
|
||||
spawnableActorList_addIfMapVisited(&chShrapnelDescription, actor_new, ACTOR_FLAG_UNKNOWN_0 | ACTOR_FLAG_UNKNOWN_8 | ACTOR_FLAG_UNKNOWN_25, MAP_7_TTC_TREASURE_TROVE_COVE); //scrapnel
|
||||
|
Reference in New Issue
Block a user