MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSweptSphereToSphere

Function xSweptSphereToSphere

src/SB/Core/x/xCollide.cpp:1589–1619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1587
1588 F32 distzsqr = var_18.z - xsqrt(testdist);
1589 if (distzsqr >= sws->curdist)
1590 return 0;
1591 if (distzsqr <= -sws->radius)
1592 return 0;
1593
1594 sws->curdist = distzsqr;
1595
1596 F32 lerp = sws->radius / (sws->radius + sph->r);
1597 sws->contact.x = var_18.x * lerp;
1598 sws->contact.y = var_18.y * lerp;
1599 sws->contact.z = var_18.z * lerp + distzsqr * (1.0f - lerp);
1600
1601 sws->polynorm.x = 0.0f;
1602 sws->polynorm.y = 0.0f;
1603 sws->polynorm.z = 0.0f;
1604
1605 return 1;
1606}
1607
1608S32 xSweptSphereToBox(xSweptSphere* sws, xBox* box, xMat4x3* mat)
1609{
1610 S32 i;
1611 xMat4x3 tmpmat;
1612 xMat4x3* boxinvbasis;
1613
1614 if (!sws->dist)
1615 return 0;
1616
1617 F32 dx = box->upper.x - box->lower.x;
1618 F32 dy = box->upper.y - box->lower.y;
1619 F32 dz = box->upper.z - box->lower.z;
1620
1621 if (mat)
1622 {

Callers 1

SweptSphereHitsEntCBFunction · 0.70

Calls 2

xMat4x3ToworldFunction · 0.85
xsqrtFunction · 0.85

Tested by

no test coverage detected