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 1346c58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 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
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -822,7 +822,7 @@ export class Contact {
}
}

solveVelocityConstraint(step: TimeStep): void {
solveVelocityConstraint(step: TimeStep): void { // TODO das ist irgendwie anders implementiert?
const bodyA = this.m_fixtureA.m_body;
const bodyB = this.m_fixtureB.m_body;

Expand Down

0 comments on commit 1346c58

Please sign in to comment.