fixed lint issues

This commit is contained in:
Joachim Grill 2018-06-04 11:12:02 +02:00
parent bc4186061c
commit 6c58bd9029

View file

@ -68,7 +68,8 @@ var PhysicsEditorLoader = {
options = options || {};
for (v = 0; v < vertexSets.length; v += 1) {
for (v = 0; v < vertexSets.length; v += 1)
{
parts.push(Body.create(Common.extend({
position: Vertices.centre(vertexSets[v]),
vertices: vertexSets[v]
@ -76,27 +77,33 @@ var PhysicsEditorLoader = {
}
// flag coincident part edges
var coincident_max_dist = 5;
var coincidentMaxDist = 5;
for (i = 0; i < parts.length; i++) {
for (i = 0; i < parts.length; i++)
{
var partA = parts[i];
for (j = i + 1; j < parts.length; j++) {
for (j = i + 1; j < parts.length; j++)
{
var partB = parts[j];
if (Bounds.overlaps(partA.bounds, partB.bounds)) {
if (Bounds.overlaps(partA.bounds, partB.bounds))
{
var pav = partA.vertices,
pbv = partB.vertices;
// iterate vertices of both parts
for (k = 0; k < partA.vertices.length; k++) {
for (z = 0; z < partB.vertices.length; z++) {
for (k = 0; k < partA.vertices.length; k++)
{
for (z = 0; z < partB.vertices.length; z++)
{
// find distances between the vertices
var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])),
db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length]));
// if both vertices are very close, consider the edge concident (internal)
if (da < coincident_max_dist && db < coincident_max_dist) {
if (da < coincidentMaxDist && db < coincidentMaxDist)
{
pav[k].isInternal = true;
pbv[z].isInternal = true;
}