Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
zOadT committed Aug 3, 2023
1 parent 4c64f4d commit 0a35b42
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
12 changes: 0 additions & 12 deletions src/collision/Distance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export const Distance = function (output: DistanceOutput, cache: SimplexCache, i
const saveB = []; // int[3]
let saveCount = 0;

let distanceSqr1 = Infinity;

// Main iteration loop.
let iter = 0;
while (iter < k_maxIters) {
Expand All @@ -130,16 +128,6 @@ export const Distance = function (output: DistanceOutput, cache: SimplexCache, i
break;
}

// Compute closest point.
const p = simplex.getClosestPoint();
const distanceSqr2 = p.lengthSquared();

// Ensure progress
if (distanceSqr2 >= distanceSqr1) {
// break;
}
distanceSqr1 = distanceSqr2;

// Get search direction.
const d = simplex.getSearchDirection();

Expand Down
1 change: 1 addition & 0 deletions src/collision/shape/PolygonShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class PolygonShape extends Shape {
let ih = i0;

while (true) {
_ASSERT && console.assert(m < Settings.maxPolygonVertices);
hull[m] = ih;

let ie = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/dynamics/Contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type ContactCallback = (

/**
* Friction mixing law. The idea is to allow either fixture to drive the
* restitution to zero. For example, anything slides on ice.
* friction to zero. For example, anything slides on ice.
*/
export function mixFriction(friction1: number, friction2: number): number {
return Math.sqrt(friction1 * friction2);
Expand Down

0 comments on commit 0a35b42

Please sign in to comment.