mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-13 04:24:14 +00:00
cleanup around ColliderJntSphElement
usage
This commit is contained in:
parent
6f8b4d82d5
commit
974036756a
3 changed files with 15 additions and 14 deletions
|
@ -159,7 +159,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, PlayState* play) {
|
||||||
void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
|
void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
|
||||||
BgHidanRsekizou* this = (BgHidanRsekizou*)thisx;
|
BgHidanRsekizou* this = (BgHidanRsekizou*)thisx;
|
||||||
s32 i;
|
s32 i;
|
||||||
ColliderJntSphElement* sphere;
|
ColliderJntSphElement* element;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
f32 yawSine;
|
f32 yawSine;
|
||||||
f32 yawCosine;
|
f32 yawCosine;
|
||||||
|
@ -179,12 +179,14 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
|
||||||
yawCosine = Math_CosS(this->dyna.actor.shape.rot.y);
|
yawCosine = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
|
for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
|
||||||
sphere = &this->collider.elements[i];
|
element = &this->collider.elements[i];
|
||||||
sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x +
|
element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x +
|
||||||
yawSine * sphere->dim.modelSphere.center.z;
|
(yawCosine * element->dim.modelSphere.center.x) +
|
||||||
sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y;
|
(yawSine * element->dim.modelSphere.center.z);
|
||||||
sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) +
|
element->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + element->dim.modelSphere.center.y;
|
||||||
yawCosine * sphere->dim.modelSphere.center.z;
|
element->dim.worldSphere.center.z = this->dyna.actor.home.pos.z -
|
||||||
|
(yawSine * element->dim.modelSphere.center.x) +
|
||||||
|
(yawCosine * element->dim.modelSphere.center.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
|
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
|
||||||
|
|
|
@ -70,7 +70,7 @@ static InitChainEntry sInitChain[] = {
|
||||||
|
|
||||||
void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
|
void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
|
||||||
BgMenkuriEye* this = (BgMenkuriEye*)thisx;
|
BgMenkuriEye* this = (BgMenkuriEye*)thisx;
|
||||||
ColliderJntSphElement* colliderList;
|
s32 pad;
|
||||||
|
|
||||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||||
Collider_InitJntSph(play, &this->collider);
|
Collider_InitJntSph(play, &this->collider);
|
||||||
|
@ -78,8 +78,7 @@ void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
|
||||||
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
|
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
|
||||||
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
|
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
|
||||||
this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
|
this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
|
||||||
colliderList = this->collider.elements;
|
this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius;
|
||||||
colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius;
|
|
||||||
if (!Flags_GetSwitch(play, this->actor.params)) {
|
if (!Flags_GetSwitch(play, this->actor.params)) {
|
||||||
sNumEyesShot = 0;
|
sNumEyesShot = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1304,12 +1304,12 @@ void BossFd_Effects(BossFd* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossFd_CollisionCheck(BossFd* this, PlayState* play) {
|
void BossFd_CollisionCheck(BossFd* this, PlayState* play) {
|
||||||
ColliderJntSphElement* headCollider = &this->collider.elements[0];
|
ColliderJntSphElement* headColliderElem = &this->collider.elements[0];
|
||||||
ColliderElement* acHitElem;
|
ColliderElement* acHitElem;
|
||||||
|
|
||||||
if (headCollider->base.acElemFlags & ACELEM_HIT) {
|
if (headColliderElem->base.acElemFlags & ACELEM_HIT) {
|
||||||
headCollider->base.acElemFlags &= ~ACELEM_HIT;
|
headColliderElem->base.acElemFlags &= ~ACELEM_HIT;
|
||||||
acHitElem = headCollider->base.acHitElem;
|
acHitElem = headColliderElem->base.acHitElem;
|
||||||
this->actor.colChkInfo.health -= 2;
|
this->actor.colChkInfo.health -= 2;
|
||||||
if (acHitElem->atDmgInfo.dmgFlags & DMG_ARROW_ICE) {
|
if (acHitElem->atDmgInfo.dmgFlags & DMG_ARROW_ICE) {
|
||||||
this->actor.colChkInfo.health -= 2;
|
this->actor.colChkInfo.health -= 2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue