Skip to content

Commit 1346c58

Browse files
committed
refactor: remove dead code
1 parent 4c64f4d commit 1346c58

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/collision/Distance.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ export const Distance = function (output: DistanceOutput, cache: SimplexCache, i
111111
const saveB = []; // int[3]
112112
let saveCount = 0;
113113

114-
let distanceSqr1 = Infinity;
115-
116114
// Main iteration loop.
117115
let iter = 0;
118116
while (iter < k_maxIters) {
@@ -130,16 +128,6 @@ export const Distance = function (output: DistanceOutput, cache: SimplexCache, i
130128
break;
131129
}
132130

133-
// Compute closest point.
134-
const p = simplex.getClosestPoint();
135-
const distanceSqr2 = p.lengthSquared();
136-
137-
// Ensure progress
138-
if (distanceSqr2 >= distanceSqr1) {
139-
// break;
140-
}
141-
distanceSqr1 = distanceSqr2;
142-
143131
// Get search direction.
144132
const d = simplex.getSearchDirection();
145133

src/collision/shape/PolygonShape.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ export class PolygonShape extends Shape {
206206
let ih = i0;
207207

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

211212
let ie = 0;

src/dynamics/Contact.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export type ContactCallback = (
8686

8787
/**
8888
* Friction mixing law. The idea is to allow either fixture to drive the
89-
* restitution to zero. For example, anything slides on ice.
89+
* friction to zero. For example, anything slides on ice.
9090
*/
9191
export function mixFriction(friction1: number, friction2: number): number {
9292
return Math.sqrt(friction1 * friction2);
@@ -822,7 +822,7 @@ export class Contact {
822822
}
823823
}
824824

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

0 commit comments

Comments
 (0)