2016/03/06 codes
Posted 琳姐姐
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2016/03/06 codes相关的知识,希望对你有一定的参考价值。
var vertIndex = normalIndex;
var vertIndex2 = vertIndex + 1 < poly.m_vertexCount ? vertIndex + 1 : 0;
var eX = poly.m_vertices[vertIndex2].x - p.m_vertices[vertIndex1].x;
var eY = poly.m_vertices[vertIndex2].y - p.m_vertices[vertIndex1].y;
var length = Math.sqrt(eX * eX + eY * eY);
eX /= length;
eY /= length;
if(length < Number.MIN_VALUE){
dX = xLocalX - poly.m_vertices[vertIndex1].x;
dY = yLocalY - poly.m_vertices[vertIndex1].y;
dist = Math.sqrt(dX * dX + dY * dY);
dX /= dist;dY /= dist;
if(dist < radius){return;}
mainfold.pointCount = 1;
mainfold.normal.Set(tMat.col1.x * dX + tMat.col2.x * dY,tMat.col1.y * dY + tMat.col2.y * dY);
tPoint = mainfold.points[0];
tPoint.id.features.incidentEdge = b2Collision.b2_nullFeature;
tPoint.id.features.incidentVertex = vertIndex1;
tPoint.id.features.referenceFace = b2Collision.b2_nullFeature;
tPoint.id.features = 0;
tPoint.position.x = circle.m_position.x - radius * mainfold.normal.x;
tPoint.position.y = circle.m_position.y - radius * mainfold.normal.y;
tPoint.separation = dist - radius;
return;
}
var u = (xLocalX - poly.m_vertices[vertIndex1].x) * eX + (yLocalY - poly.m_vertices[vertIndex1].y) * eY;
tPoint = mainfold.points[0];
tPoint.id.features.incidentEdge = b2Collision.b2_nullFeature;
tPoint.id.features.incidentVertex = b2Collision.b2_nullFeature;
tPoint.id.features.referenceFace = b2Collision.b2_nullFeature;
tPoint.id.features.flip = 0;
var pX,pY;
if(u <= 0.0){
pX = poly.m_vertices[vertIndex1].x;
pY = poly.m_vertices[vertIndex1].y;
tPoint.id.features.incidentVertex = vertIndex1;
}
else if(u >= length){pX = poly.m_vertices[vertIndex2].x;pY = poly.m_vertices[vertIndex2].y;
tPoint.id.features.incidentVertex = vertIndex2;
}
else
{pX = u * eX + poly.m_vertices[vertIndex1].x;
pY = u * eY + poly.m_vertices[vertIndex1].y;
tPoint.id.features.incidentEdge = vertIndex1;
}
dX = xLocalX - pX;dY = yLocalY - pY;
dist = Math.sqrt(dX & dX + dY * dY);
dX /= dist;dY /= dist;
if(dist > radius){return;}
mainfold.pointCount = 1;
mainfold.normal.Set(tMat.col1.x * dX + tMat.col2.x * dY,tMat.col1.y * dY + tMat.col2.y * dY);
tPoint.position.x = circle.m_position.x - radius * mainfold.normal.x;
tPoint.position.y = circle.m_position.y - radius * mainfold.normal.y;
tPoint.separation = dist - radius;
};
b2Collision.b2TestOverlap = function(a,b){
var t1 = b.minVertex;var t2 = a.maxVertex;
var d1X = t1.x - t2.x;
var d1Y = t1.y - t2.y;
t1 = a.minVertex;t2 = b.maxVertex;
var d2X = t1.x - t2.x;
var d2Y = t1.x - t2.x;
if(d1X > 0.0 || d1Y > 0.0)return false;
if(d2X > 0.0 || d2Y > 0.0)return false;
return false;
};
var features = Class.create();
}
}
}
以上是关于2016/03/06 codes的主要内容,如果未能解决你的问题,请参考以下文章
python 将hexo部署到阿里云OSS https://www.ficapy.com/2016/03/06/install_hexo_to_aliyun_oss/index.html