Tuple operations

This commit is contained in:
Nabnut
2024-09-22 11:24:26 +02:00
parent fbe20325c2
commit bb58ae66e9
30 changed files with 205 additions and 260 deletions

View File

@@ -338,10 +338,8 @@ void chflibbit_update(Actor *this){
}
player_getPosition(player_position);
spB0[0] = player_position[0] - this->position[0];
spB0[1] = player_position[1] - this->position[1];
spB0[2] = player_position[2] - this->position[2];
player_distance = gu_sqrtf(spB0[0]*spB0[0] + spB0[1]*spB0[1] + spB0[2]*spB0[2]);
TUPLE_DIFF_COPY(spB0, player_position, this->position)
player_distance = LENGTH_VEC3F(spB0);
if(ml_timer_update(&local->unk24, spA4)){
func_8030E878(0x3f0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f);
@@ -427,15 +425,11 @@ void chflibbit_update(Actor *this){
}
if(this->state == 6){
sp4C[0] = this->position[0] - player_position[0];
sp4C[1] = this->position[1] - player_position[1];
sp4C[2] = this->position[2] - player_position[2];
TUPLE_DIFF_COPY(sp4C, this->position, player_position)
sp4C[1] = 0.0f;
ml_vec3f_set_length(sp4C, 400.0f * spA4);
this->position[0] = this->position[0] + sp4C[0];
this->position[1] = this->position[1] + sp4C[1];
this->position[2] = this->position[2] + sp4C[2];
TUPLE_ADD_COPY(this->position, this->position, sp4C)
this->position_y += local->unk14*spA4;
local->unk14 -= 3000.0f*spA4;

View File

@@ -88,7 +88,7 @@ void chmudhut_update(Actor *this){
if( (150.0f < diffPos[1])
&& (player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER)
&& (func_8028F20C())
&& (gu_sqrtf(diffPos[0]*diffPos[0] + diffPos[1]*diffPos[1] + diffPos[2]*diffPos[2]) < 350.f)
&& (LENGTH_VEC3F(diffPos) < 350.f)
){
tmp = (s32)( (this->position_y - 600.f)/430.0f);
diffPos[0] = this->position_x;

View File

@@ -371,7 +371,7 @@ void BGS_func_8038E034(Actor *this) {
spA8[0] = spB4[0] - this->position[0];
spA8[1] = spB4[1] - this->position[1];
spA8[2] = spB4[2] - this->position[2];
spA4 = gu_sqrtf(spA8[0]*spA8[0] + spA8[1]*spA8[1] + spA8[2]*spA8[2]);
spA4 = LENGTH_VEC3F(spA8);
if (ml_timer_update(&local->unk28, sp9C) != 0) {
func_8030E878(0x3F0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f);
local->unk28 = randf2(1.0f, 6.0f);

View File

@@ -132,14 +132,11 @@ void BGS_func_80389850(Actor *this, s32 arg1) {
local = (ActorLocal_BGS_3420 *)&this->local;
vile = marker_getActor(local->vile_marker);
if (arg1 != 0) {
if (gu_sqrtf(this->position[0]*this->position[0] + this->position[1]*this->position[1] + this->position[2]*this->position[2]) < 800.0f) {
sp7C[0] = 0.0f;
sp7C[1] = 150.0f;
sp7C[2] = 300.0f;
if (LENGTH_VEC3F(this->position) < 800.0f) {
TUPLE_ASSIGN(sp7C, 0.0f, 150.0f, 300.0f)
ml_vec3f_yaw_rotate_copy(sp7C, sp7C, vile->yaw);
sp94[0] = vile->position[0] + sp7C[0];
sp94[1] = vile->position[1] + sp7C[1];
sp94[2] = vile->position[2] + sp7C[2];
TUPLE_ADD_COPY(sp94, vile->position, sp7C)
func_802C8F70(vile->yaw);
jiggy_spawn(JIGGY_28_BGS_MR_VILE, sp94);
} else {