diff --git a/DataSpec/DNACommon/OBBTreeBuilder.cpp b/DataSpec/DNACommon/OBBTreeBuilder.cpp index d684c6b38..a06d22e24 100644 --- a/DataSpec/DNACommon/OBBTreeBuilder.cpp +++ b/DataSpec/DNACommon/OBBTreeBuilder.cpp @@ -119,6 +119,10 @@ static FittedOBB FitOBB(const ColMesh& mesh, const std::vector& index) cyy += ( 9.0*mui.y*mui.y + p.y*p.y + q.y*q.y + r.y*r.y )*(Ai/12.0); cyz += ( 9.0*mui.y*mui.z + p.y*p.z + q.y*q.z + r.y*r.z )*(Ai/12.0); } + + if (zeus::close_enough(Am, 0.f)) + return {}; + // divide out the Am fraction from the average position and // covariance terms mu = mu / Am; @@ -131,7 +135,7 @@ static FittedOBB FitOBB(const ColMesh& mesh, const std::vector& index) // now build the covariance matrix C(0,0)=cxx; C(0,1)=cxy; C(0,2)=cxz; C(1,0)=cxy; C(1,1)=cyy; C(1,2)=cyz; - C(2,0)=cxz; C(1,2)=cyz; C(2,2)=czz; + C(2,0)=cxz; C(2,1)=cyz; C(2,2)=czz; // set the obb parameters from the covariance matrix return BuildFromCovarianceMatrix(C, mesh, index); diff --git a/DataSpec/DNAMP1/ANIM.cpp b/DataSpec/DNAMP1/ANIM.cpp index bd840ad56..bf0a2f298 100644 --- a/DataSpec/DNAMP1/ANIM.cpp +++ b/DataSpec/DNAMP1/ANIM.cpp @@ -649,10 +649,14 @@ ANIM::ANIM(const BlenderAction& act, newAnim.chanKeys.emplace_back(); std::vector& rotVals = newAnim.chanKeys.back(); rotVals.reserve(chan.keys.size()); + float sign = 0.f; for (const BlenderAction::Channel::Key& key : chan.keys) { zeus::CQuaternion q(key.rotation.val); q = rig.restoreRotation(newChan.id, q); + if (sign == 0.f) + sign = q.w < 0.f ? -1.f : 1.f; + q *= sign; rotVals.emplace_back(q.w, q.x, q.y, q.z); } diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 3a8b5b777..eecff006c 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -59,9 +59,9 @@ void Buckets::Sort() if (sPlaneObjectBucket->size()) { std::sort(sPlaneObjectBucket->begin(), sPlaneObjectBucket->end(), - [](u16 a, u16 b) -> bool + [](u16 a, u16 b) { - return (*sPlaneObjectData)[a].GetDistance() >= (*sPlaneObjectData)[b].GetDistance(); + return (*sPlaneObjectData)[a].GetDistance() > (*sPlaneObjectData)[b].GetDistance(); }); precision = 50 / u32(sPlaneObjectBucket->size() + 1); pitch = 1.f / (delta / float(precision - 2)); @@ -128,8 +128,10 @@ void Buckets::Sort() if (bucket.size()) { std::sort(bucket.begin(), bucket.end(), - [](CDrawable* a, CDrawable* b) -> bool + [](CDrawable* a, CDrawable* b) { + if (a->GetDistance() == b->GetDistance()) + return a->GetExtraSort() > b->GetExtraSort(); return a->GetDistance() > b->GetDistance(); }); } @@ -747,7 +749,8 @@ void CBooRenderer::AddWorldSurfaces(CBooModel& model) zeus::CAABox aabb = surf->GetBounds(); zeus::CVector3f pt = aabb.closestPointAlongVector(xb0_viewPlane.vec); Buckets::Insert(pt, aabb, EDrawableType::WorldSurface, surf, xb0_viewPlane, - mat.heclIr.m_blendDst != boo::BlendFactor::Zero); + mat.heclIr.m_blendSrc == boo::BlendFactor::SrcAlpha && + mat.heclIr.m_blendDst == boo::BlendFactor::InvSrcAlpha); surf = surf->m_next; } } diff --git a/Runtime/World/CScriptSpawnPoint.cpp b/Runtime/World/CScriptSpawnPoint.cpp index f67d66b12..fe140d457 100644 --- a/Runtime/World/CScriptSpawnPoint.cpp +++ b/Runtime/World/CScriptSpawnPoint.cpp @@ -15,6 +15,7 @@ CScriptSpawnPoint::CScriptSpawnPoint(TUniqueId uid, std::string_view name, const { x64_itemCounts[int(CPlayerState::EItemType::ThermalVisor)] = 1; x64_itemCounts[int(CPlayerState::EItemType::XRayVisor)] = 1; + x64_itemCounts[int(CPlayerState::EItemType::GrappleBeam)] = 1; x10c_24_firstSpawn = defaultSpawn; x10c_25_morphed = morphed; } diff --git a/hecl b/hecl index d6e7abc61..a2d6ffa1d 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit d6e7abc61fb51a665bf954db03798c23e1ae5f57 +Subproject commit a2d6ffa1dcea67585381a6993cdc1e083024877a