mirror of
https://github.com/sndrec/WebMonkeyBall.git
synced 2026-02-03 10:13:33 +00:00
added item to credits, fix switch collisions
This commit is contained in:
@@ -39,6 +39,10 @@
|
||||
<div>
|
||||
Amusement Vision <span>— Original game</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://discord.gg/CEYjvDj" target="_blank" rel="noopener">SMB Custom Level Community</a>
|
||||
<span>— Tools and resources</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
|
||||
@@ -1119,12 +1119,6 @@ function collideBallWithCylinder(ball, cylinder) {
|
||||
stack.rigidInvTfPoint(ball.pos, cylinderPosLocal);
|
||||
stack.rigidInvTfPoint(ball.prevPos, cylinderPrevLocal);
|
||||
|
||||
const dist2d = sumSq2(cylinderPosLocal.x, cylinderPosLocal.z);
|
||||
const radiusSum = cylinder.radius + ball.radius;
|
||||
if (dist2d > radiusSum * radiusSum || dist2d < FLT_EPSILON) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cylinderPrevLocal.y < 0.5 * -cylinder.height) {
|
||||
cylinderCircle.pos.x = 0;
|
||||
cylinderCircle.pos.y = 0.5 * -cylinder.height;
|
||||
@@ -1150,6 +1144,12 @@ function collideBallWithCylinder(ball, cylinder) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dist2d = sumSq2(cylinderPosLocal.x, cylinderPosLocal.z);
|
||||
const radiusSum = cylinder.radius + ball.radius;
|
||||
if (dist2d > radiusSum * radiusSum || dist2d < FLT_EPSILON) {
|
||||
return;
|
||||
}
|
||||
|
||||
const invLen = rsqrt(dist2d);
|
||||
cylinderPlane.point.x = cylinderPosLocal.x * invLen * cylinder.radius;
|
||||
cylinderPlane.point.y = cylinderPosLocal.y;
|
||||
|
||||
Reference in New Issue
Block a user