projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed polygon penitration due to CoR
[physics.git]
/
src
/
collisionManager.cpp
diff --git
a/src/collisionManager.cpp
b/src/collisionManager.cpp
index
8aa2dc7
..
95a2193
100644
(file)
--- a/
src/collisionManager.cpp
+++ b/
src/collisionManager.cpp
@@
-273,8
+273,8
@@
void applyCollision(Polygon* pPoly, Ball* pBall)
// CoR penetration fix, adds the jitters
// from center to point
// CoR penetration fix, adds the jitters
// from center to point
-
//Vector2 CollP = normal / normal.Length * Ball.R
adius;
-
//Ball.Position = Info.Point + CollP
;
+
Vector2 vecCollP = vecNorm / vecNorm.length() * pBall->r
adius;
+
pBall->applyNudge(cInfo.point + vecCollP - pBall->positionRaw())
;
}
bool getInfo(const Ball* b1, const Ball* b2, CollisionInfo* pcInfo)
}
bool getInfo(const Ball* b1, const Ball* b2, CollisionInfo* pcInfo)