本文整理汇总了Java中com.badlogic.gdx.utils.IntArray.set方法的典型用法代码示例。如果您正苦于以下问题:Java IntArray.set方法的具体用法?Java IntArray.set怎么用?Java IntArray.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.IntArray
的用法示例。
在下文中一共展示了IntArray.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calchull
import com.badlogic.gdx.utils.IntArray; //导入方法依赖的package包/类
private int calchull (ObjectArrayList<Vector3> verts, int verts_count, IntArray tris_out, int[] tris_count, int vlimit) {
int rc = calchullgen(verts, verts_count, vlimit);
if (rc == 0) return 0;
IntArray ts = new IntArray();
for (int i = 0; i < tris.size(); i++) {
if (tris.getQuick(i) != null) {
for (int j = 0; j < 3; j++) {
ts.add((tris.getQuick(i)).getCoord(j));
}
deAllocateTriangle(tris.getQuick(i));
}
}
tris_count[0] = ts.size / 3;
MiscUtil.resize(tris_out, ts.size, 0);
for (int i = 0; i < ts.size; i++) {
tris_out.set(i, ts.get(i));
}
MiscUtil.resize(tris, 0, NEW_TRI_SUPPLIER);
return 1;
}
示例2: bringOutYourDead
import com.badlogic.gdx.utils.IntArray; //导入方法依赖的package包/类
private void bringOutYourDead (ObjectArrayList<Vector3> verts, int vcount, ObjectArrayList<Vector3> overts, int[] ocount,
IntArray indices, int indexcount) {
IntArray tmpIndices = new IntArray();
for (int i = 0; i < vertexIndexMapping.size; i++) {
tmpIndices.add(vertexIndexMapping.size);
}
IntArray usedIndices = new IntArray();
MiscUtil.resize(usedIndices, vcount, 0);
/*
* JAVA NOTE: redudant for (int i=0; i<vcount; i++) { usedIndices.set(i, 0); }
*/
ocount[0] = 0;
for (int i = 0; i < indexcount; i++) {
int v = indices.get(i); // original array index
assert (v >= 0 && v < vcount);
if (usedIndices.get(v) != 0) { // if already remapped
indices.set(i, usedIndices.get(v) - 1); // index to new array
} else {
indices.set(i, ocount[0]); // new index mapping
overts.getQuick(ocount[0]).set(verts.getQuick(v)); // copy old vert to new vert array
for (int k = 0; k < vertexIndexMapping.size; k++) {
if (tmpIndices.get(k) == v) {
vertexIndexMapping.set(k, ocount[0]);
}
}
ocount[0]++; // increment output vert count
assert (ocount[0] >= 0 && ocount[0] <= vcount);
usedIndices.set(v, ocount[0]); // assign new index remapping
}
}
}
示例3: maxdirsterid
import com.badlogic.gdx.utils.IntArray; //导入方法依赖的package包/类
private static int maxdirsterid (ObjectArrayList<Vector3> p, int count, Vector3 dir, IntArray allow) {
Stack stack = Stack.enter();
Vector3 tmp = stack.allocVector3();
Vector3 tmp1 = stack.allocVector3();
Vector3 tmp2 = stack.allocVector3();
Vector3 u = stack.allocVector3();
Vector3 v = stack.allocVector3();
int m = -1;
while (m == -1) {
m = maxdirfiltered(p, count, dir, allow);
if (allow.get(m) == 3) {
return m;
}
orth(dir, u);
v.set(u).crs(dir);
int ma = -1;
for (float x = 0f; x <= 360f; x += 45f) {
float s = (float)Math.sin(BulletGlobals.SIMD_RADS_PER_DEG * (x));
float c = (float)Math.cos(BulletGlobals.SIMD_RADS_PER_DEG * (x));
tmp1.set(u).scl(s);
tmp2.set(v).scl(c);
tmp.set(tmp1).add(tmp2);
tmp.scl(0.025f);
tmp.add(dir);
int mb = maxdirfiltered(p, count, tmp, allow);
if (ma == m && mb == m) {
allow.set(m, 3);
stack.leave();
return m;
}
if (ma != -1 && ma != mb) { // Yuck - this is really ugly
int mc = ma;
for (float xx = x - 40f; xx <= x; xx += 5f) {
s = (float)Math.sin(BulletGlobals.SIMD_RADS_PER_DEG * (xx));
c = (float)Math.cos(BulletGlobals.SIMD_RADS_PER_DEG * (xx));
tmp1.set(u).scl(s);
tmp2.set(v).scl(c);
tmp.set(tmp1).add(tmp2);
tmp.scl(0.025f);
tmp.add(dir);
int md = maxdirfiltered(p, count, tmp, allow);
if (mc == m && md == m) {
allow.set(m, 3);
stack.leave();
return m;
}
mc = md;
}
}
ma = mb;
}
allow.set(m, 0);
m = -1;
}
assert (false);
stack.leave();
return m;
}