2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:47:43 +00:00

zeus constexpr refactor and thermal visor fixes

This commit is contained in:
Jack Andersen
2019-02-23 21:15:54 -10:00
parent 1186b8097c
commit 8df0a4913c
226 changed files with 1339 additions and 1305 deletions

View File

@@ -41,14 +41,14 @@ void CSimpleShadow::Render(const TLockedToken<CTexture>& tex) const {
{{radius, 0.f, -radius}, {0.f, 1.f}},
{{-radius, 0.f, radius}, {1.f, 0.f}},
{{radius, 0.f, radius}, {1.f, 1.f}}};
m_filter->drawVerts(zeus::CColor::skWhite, verts);
m_filter->drawVerts(zeus::skWhite, verts);
}
void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform& xf, const CStateManager& mgr) {
x48_24_collision = false;
float halfHeight = (aabb.max.z() - aabb.min.z()) * 0.5f;
zeus::CVector3f pos = xf.origin + zeus::CVector3f(0.f, 0.f, halfHeight);
CRayCastResult res = mgr.RayStaticIntersection(pos, zeus::CVector3f::skDown, x40_maxObjHeight,
CRayCastResult res = mgr.RayStaticIntersection(pos, zeus::skDown, x40_maxObjHeight,
CMaterialFilter::MakeExclude({EMaterialTypes::SeeThrough}));
float height = x40_maxObjHeight;
if (res.IsValid()) {
@@ -60,7 +60,7 @@ void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform&
TUniqueId cid = kInvalidUniqueId;
rstl::reserved_vector<TUniqueId, 1024> nearList;
CRayCastResult resD = CGameCollision::RayDynamicIntersection(
mgr, cid, pos, zeus::CVector3f::skDown, x40_maxObjHeight, CMaterialFilter::skPassEverything, nearList);
mgr, cid, pos, zeus::skDown, x40_maxObjHeight, CMaterialFilter::skPassEverything, nearList);
if (resD.IsValid() && resD.GetT() < height) {
x48_24_collision = true;
height = resD.GetT();
@@ -70,7 +70,7 @@ void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform&
if (x48_24_collision) {
x3c_heightAlpha = 1.f - height / x40_maxObjHeight;
x0_xf = zeus::lookAt(res.GetPlane().normal(), zeus::CVector3f::skZero);
x0_xf = zeus::lookAt(res.GetPlane().normal(), zeus::skZero3f);
x0_xf.origin = res.GetPlane().normal() * x44_displacement + res.GetPoint();
if (x48_25_alwaysCalculateRadius || !x48_26_radiusCalculated) {
float xExtent = aabb.max.x() - aabb.min.x();