mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-09-03 03:32:37 +02:00
Fixed fuck up.
This commit is contained in:
@@ -788,14 +788,11 @@ CCollision::ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CCol
|
|||||||
{
|
{
|
||||||
CVector dist = s1.center - s2.center;
|
CVector dist = s1.center - s2.center;
|
||||||
float d = dist.Magnitude() - s2.radius; // distance from s1's center to s2
|
float d = dist.Magnitude() - s2.radius; // distance from s1's center to s2
|
||||||
float mag = dist.Magnitude();
|
|
||||||
float d = mag - s2.radius; // distance from s1's center to s2
|
|
||||||
float depth = s1.radius - d; // sphere overlap
|
float depth = s1.radius - d; // sphere overlap
|
||||||
if(d < 0.0f) d = 0.0f; // clamp to zero, i.e. if s1's center is inside s2
|
if(d < 0.0f) d = 0.0f; // clamp to zero, i.e. if s1's center is inside s2
|
||||||
// no collision if sphere is not close enough
|
// no collision if sphere is not close enough
|
||||||
if(d*d < mindistsq && d < s1.radius){
|
if(d*d < mindistsq && d < s1.radius){
|
||||||
dist.Normalise();
|
dist.Normalise();
|
||||||
dist *= Invert<true, false>(mag);
|
|
||||||
point.point = s1.center - dist*d;
|
point.point = s1.center - dist*d;
|
||||||
point.normal = dist;
|
point.normal = dist;
|
||||||
#ifndef VU_COLLISION
|
#ifndef VU_COLLISION
|
||||||
|
Reference in New Issue
Block a user