mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 14:31:17 +00:00
Match even more retail actors (#1720)
* Match even more actors
* Add macro for DebugDisplay_AddObject
* Prefer OOT_DEBUG &&
* Better EnReeba_Stunned match
* Revert "Add macro for DebugDisplay_AddObject"
This reverts commit 8197823abb
.
* Prefer OOT_DEBUG && some more
* Reformatting
* Add fake match comment
This commit is contained in:
parent
1ba2d6d0f9
commit
b32d0a91ed
26 changed files with 217 additions and 179 deletions
|
@ -373,8 +373,6 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection*
|
|||
f32 spE8[3];
|
||||
f32 polyNormal[3];
|
||||
MtxF* shieldMtx;
|
||||
Vec3f vecA;
|
||||
Vec3f vecC;
|
||||
|
||||
shieldMtx = &player->shieldMf;
|
||||
|
||||
|
@ -390,75 +388,80 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection*
|
|||
vecD.y = spE8[1] + vecB.y;
|
||||
vecD.z = spE8[2] + vecB.z;
|
||||
|
||||
vecA.x = vecB.x + (shieldMtx->xx * 300.0f);
|
||||
vecA.y = vecB.y + (shieldMtx->yx * 300.0f);
|
||||
vecA.z = vecB.z + (shieldMtx->zx * 300.0f);
|
||||
{
|
||||
Vec3f vecA;
|
||||
Vec3f vecC;
|
||||
|
||||
vecC.x = vecD.x + (shieldMtx->xx * 300.0f);
|
||||
vecC.y = vecD.y + (shieldMtx->yx * 300.0f);
|
||||
vecC.z = vecD.z + (shieldMtx->zx * 300.0f);
|
||||
vecA.x = vecB.x + (shieldMtx->xx * 300.0f);
|
||||
vecA.y = vecB.y + (shieldMtx->yx * 300.0f);
|
||||
vecA.z = vecB.z + (shieldMtx->zx * 300.0f);
|
||||
|
||||
Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD);
|
||||
vecC.x = vecD.x + (shieldMtx->xx * 300.0f);
|
||||
vecC.y = vecD.y + (shieldMtx->yx * 300.0f);
|
||||
vecC.z = vecD.z + (shieldMtx->zx * 300.0f);
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (reflection[i].reflectionPoly != NULL) {
|
||||
polyNormal[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x);
|
||||
polyNormal[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y);
|
||||
polyNormal[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z);
|
||||
Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD);
|
||||
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], reflection[i].reflectionPoly->dist,
|
||||
&vecB, &vecD, &sp118, 1)) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (reflection[i].reflectionPoly != NULL) {
|
||||
polyNormal[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x);
|
||||
polyNormal[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y);
|
||||
polyNormal[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z);
|
||||
|
||||
reflection[i].pos.x = sp118.x;
|
||||
reflection[i].pos.y = sp118.y;
|
||||
reflection[i].pos.z = sp118.z;
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2],
|
||||
reflection[i].reflectionPoly->dist, &vecB, &vecD, &sp118, 1)) {
|
||||
|
||||
temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z));
|
||||
reflection[i].pos.x = sp118.x;
|
||||
reflection[i].pos.y = sp118.y;
|
||||
reflection[i].pos.z = sp118.z;
|
||||
|
||||
if (temp_f0 < (this->reflectIntensity * 600.0f)) {
|
||||
reflection[i].opacity = 200;
|
||||
temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z));
|
||||
|
||||
if (temp_f0 < (this->reflectIntensity * 600.0f)) {
|
||||
reflection[i].opacity = 200;
|
||||
} else {
|
||||
reflection[i].opacity = (s32)(800.0f - temp_f0);
|
||||
}
|
||||
|
||||
sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x;
|
||||
sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y;
|
||||
sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z;
|
||||
|
||||
sp100.x = (spE8[0] * 4.0f) + sp10C.x;
|
||||
sp100.y = (spE8[1] * 4.0f) + sp10C.y;
|
||||
sp100.z = (spE8[2] * 4.0f) + sp10C.z;
|
||||
|
||||
reflection[i].mtx.zw = 0.0f;
|
||||
|
||||
reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f;
|
||||
reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy =
|
||||
reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz =
|
||||
reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw;
|
||||
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2],
|
||||
reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) {
|
||||
reflection[i].mtx.xx = intersection.x - sp118.x;
|
||||
reflection[i].mtx.yx = intersection.y - sp118.y;
|
||||
reflection[i].mtx.zx = intersection.z - sp118.z;
|
||||
}
|
||||
|
||||
sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x;
|
||||
sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y;
|
||||
sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z;
|
||||
|
||||
sp100.x = (spE8[0] * 4.0f) + sp10C.x;
|
||||
sp100.y = (spE8[1] * 4.0f) + sp10C.y;
|
||||
sp100.z = (spE8[2] * 4.0f) + sp10C.z;
|
||||
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2],
|
||||
reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) {
|
||||
reflection[i].mtx.xy = intersection.x - sp118.x;
|
||||
reflection[i].mtx.yy = intersection.y - sp118.y;
|
||||
reflection[i].mtx.zy = intersection.z - sp118.z;
|
||||
}
|
||||
} else {
|
||||
reflection[i].opacity = (s32)(800.0f - temp_f0);
|
||||
reflection[i].reflectionPoly = NULL;
|
||||
}
|
||||
|
||||
sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x;
|
||||
sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y;
|
||||
sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z;
|
||||
|
||||
sp100.x = (spE8[0] * 4.0f) + sp10C.x;
|
||||
sp100.y = (spE8[1] * 4.0f) + sp10C.y;
|
||||
sp100.z = (spE8[2] * 4.0f) + sp10C.z;
|
||||
|
||||
reflection[i].mtx.zw = 0.0f;
|
||||
|
||||
reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f;
|
||||
reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy =
|
||||
reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz =
|
||||
reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw;
|
||||
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2],
|
||||
reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) {
|
||||
reflection[i].mtx.xx = intersection.x - sp118.x;
|
||||
reflection[i].mtx.yx = intersection.y - sp118.y;
|
||||
reflection[i].mtx.zx = intersection.z - sp118.z;
|
||||
}
|
||||
|
||||
sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x;
|
||||
sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y;
|
||||
sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z;
|
||||
|
||||
sp100.x = (spE8[0] * 4.0f) + sp10C.x;
|
||||
sp100.y = (spE8[1] * 4.0f) + sp10C.y;
|
||||
sp100.z = (spE8[2] * 4.0f) + sp10C.z;
|
||||
|
||||
if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2],
|
||||
reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) {
|
||||
reflection[i].mtx.xy = intersection.x - sp118.x;
|
||||
reflection[i].mtx.yy = intersection.y - sp118.y;
|
||||
reflection[i].mtx.zy = intersection.z - sp118.z;
|
||||
}
|
||||
} else {
|
||||
reflection[i].reflectionPoly = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue