当前位置: 首页>>代码示例>>Java>>正文


Java ArrayPool类代码示例

本文整理汇总了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();
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:10,代码来源:BulletGlobals.java

示例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;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:37,代码来源:ClipPolygon.java

示例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;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:40,代码来源:ClipPolygon.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:47,代码来源:ClipPolygon.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:59,代码来源:ClipPolygon.java


注:本文中的com.bulletphysics.util.ArrayPool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。