本文整理汇总了Java中org.jbox2d.pooling.arrays.Vec2Array类的典型用法代码示例。如果您正苦于以下问题:Java Vec2Array类的具体用法?Java Vec2Array怎么用?Java Vec2Array使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Vec2Array类属于org.jbox2d.pooling.arrays包,在下文中一共展示了Vec2Array类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: complexlogic
import org.jbox2d.pooling.arrays.Vec2Array; //导入依赖的package包/类
public final void complexlogic(final Vec2[] verts, final int num, final Vec2Array vecPool,
final IntArray intPool) {
int i0 = 1;
int[] hull = new int[Settings.maxPolygonVertices];
int m = 0;
int ih = i0;
int counter = 0;
while (true) {
counter++;
if (counter>5) {
break;
}
hull[m] = ih;
int ie = 0;
for (int j = 1; j < num; ++j) {
if (ie == ih) {
ie = j;
continue;
}
Vec2 r = pool1.set(verts[ie]).subLocal(verts[hull[m]]);
Vec2 v = pool2.set(verts[j]).subLocal(verts[hull[m]]);
float c = Vec2.cross(r, v);
if (c < 0.0f) {
ie = j;
}
if (c == 0.0f && v.lengthSquared() > r.lengthSquared()) {
ie = j;
}
}
++m;
ih = ie;
System.out.println("End of loop");
System.out.println(ie);
System.out.println(i0);
if (ie == i0) {
break;
}
}
System.out.println("Finished");
}