本文整理汇总了Java中com.bulletphysics.util.ArrayPool类的典型用法代码示例。如果您正苦于以下问题:Java ArrayPool类的具体用法?Java ArrayPool怎么用?Java ArrayPool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArrayPool类属于com.bulletphysics.util包,在下文中一共展示了ArrayPool类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanCurrentThread
import com.bulletphysics.util.ArrayPool; //导入依赖的package包/类
/**
* Cleans all current thread specific settings and caches.
*/
public static void cleanCurrentThread() {
threadLocal.remove();
Stack.libraryCleanCurrentThread();
ObjectPool.cleanCurrentThread();
ArrayPool.cleanCurrentThread();
}
示例2: plane_clip_polygon
import com.bulletphysics.util.ArrayPool; //导入依赖的package包/类
/** Clips a polygon by a plane.
*
* @return The count of the clipped counts */
public static int plane_clip_polygon (Quaternion plane, ObjectArrayList<Vector3> polygon_points, int polygon_point_count,
ObjectArrayList<Vector3> clipped) {
ArrayPool<int[]> intArrays = ArrayPool.get(int.class);
int[] clipped_count = intArrays.getFixed(1);
clipped_count[0] = 0;
// clip first point
float firstdist = distance_point_plane(plane, polygon_points.getQuick(0));
if (!(firstdist > BulletGlobals.SIMD_EPSILON)) {
clipped.getQuick(clipped_count[0]).set(polygon_points.getQuick(0));
clipped_count[0]++;
}
float olddist = firstdist;
for (int i = 1; i < polygon_point_count; i++) {
float dist = distance_point_plane(plane, polygon_points.getQuick(i));
plane_clip_polygon_collect(polygon_points.getQuick(i - 1), polygon_points.getQuick(i), olddist, dist, clipped,
clipped_count);
olddist = dist;
}
// RETURN TO FIRST point
plane_clip_polygon_collect(polygon_points.getQuick(polygon_point_count - 1), polygon_points.getQuick(0), olddist, firstdist,
clipped, clipped_count);
int ret = clipped_count[0];
intArrays.release(clipped_count);
return ret;
}
示例3: plane_clip_triangle
import com.bulletphysics.util.ArrayPool; //导入依赖的package包/类
/** Clips a polygon by a plane.
*
* @param clipped must be an array of 16 points.
* @return the count of the clipped counts */
public static int plane_clip_triangle (Quaternion plane, Vector3 point0, Vector3 point1, Vector3 point2,
ObjectArrayList<Vector3> clipped) {
ArrayPool<int[]> intArrays = ArrayPool.get(int.class);
int[] clipped_count = intArrays.getFixed(1);
clipped_count[0] = 0;
// clip first point0
float firstdist = distance_point_plane(plane, point0);
if (!(firstdist > BulletGlobals.SIMD_EPSILON)) {
clipped.getQuick(clipped_count[0]).set(point0);
clipped_count[0]++;
}
// point 1
float olddist = firstdist;
float dist = distance_point_plane(plane, point1);
plane_clip_polygon_collect(point0, point1, olddist, dist, clipped, clipped_count);
olddist = dist;
// point 2
dist = distance_point_plane(plane, point2);
plane_clip_polygon_collect(point1, point2, olddist, dist, clipped, clipped_count);
olddist = dist;
// RETURN TO FIRST point0
plane_clip_polygon_collect(point2, point0, olddist, firstdist, clipped, clipped_count);
int ret = clipped_count[0];
intArrays.release(clipped_count);
return ret;
}
示例4: plane_clip_polygon
import com.bulletphysics.util.ArrayPool; //导入依赖的package包/类
/**
* Clips a polygon by a plane.
*
* @return The count of the clipped counts
*/
public static int plane_clip_polygon(Vector4f plane, ObjectArrayList<Vector3f> polygon_points, int polygon_point_count, ObjectArrayList<Vector3f> clipped) {
ArrayPool<int[]> intArrays = ArrayPool.get(int.class);
int[] clipped_count = intArrays.getFixed(1);
clipped_count[0] = 0;
// clip first point
float firstdist = distance_point_plane(plane, polygon_points.getQuick(0));
if (!(firstdist > BulletGlobals.SIMD_EPSILON)) {
clipped.getQuick(clipped_count[0]).set(polygon_points.getQuick(0));
clipped_count[0]++;
}
float olddist = firstdist;
for (int i=1; i<polygon_point_count; i++) {
float dist = distance_point_plane(plane, polygon_points.getQuick(i));
plane_clip_polygon_collect(
polygon_points.getQuick(i - 1), polygon_points.getQuick(i),
olddist,
dist,
clipped,
clipped_count);
olddist = dist;
}
// RETURN TO FIRST point
plane_clip_polygon_collect(
polygon_points.getQuick(polygon_point_count - 1), polygon_points.getQuick(0),
olddist,
firstdist,
clipped,
clipped_count);
int ret = clipped_count[0];
intArrays.release(clipped_count);
return ret;
}
示例5: plane_clip_triangle
import com.bulletphysics.util.ArrayPool; //导入依赖的package包/类
/**
* Clips a polygon by a plane.
*
* @param clipped must be an array of 16 points.
* @return the count of the clipped counts
*/
public static int plane_clip_triangle(Vector4f plane, Vector3f point0, Vector3f point1, Vector3f point2, ObjectArrayList<Vector3f> clipped) {
ArrayPool<int[]> intArrays = ArrayPool.get(int.class);
int[] clipped_count = intArrays.getFixed(1);
clipped_count[0] = 0;
// clip first point0
float firstdist = distance_point_plane(plane, point0);
if (!(firstdist > BulletGlobals.SIMD_EPSILON)) {
clipped.getQuick(clipped_count[0]).set(point0);
clipped_count[0]++;
}
// point 1
float olddist = firstdist;
float dist = distance_point_plane(plane, point1);
plane_clip_polygon_collect(
point0, point1,
olddist,
dist,
clipped,
clipped_count);
olddist = dist;
// point 2
dist = distance_point_plane(plane, point2);
plane_clip_polygon_collect(
point1, point2,
olddist,
dist,
clipped,
clipped_count);
olddist = dist;
// RETURN TO FIRST point0
plane_clip_polygon_collect(
point2, point0,
olddist,
firstdist,
clipped,
clipped_count);
int ret = clipped_count[0];
intArrays.release(clipped_count);
return ret;
}