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


Java FloatArray.addAll方法代码示例

本文整理汇总了Java中com.badlogic.gdx.utils.FloatArray.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java FloatArray.addAll方法的具体用法?Java FloatArray.addAll怎么用?Java FloatArray.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.utils.FloatArray的用法示例。


在下文中一共展示了FloatArray.addAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFlatPixelArray

import com.badlogic.gdx.utils.FloatArray; //导入方法依赖的package包/类
public float[] getFlatPixelArray() {
    FloatArray floats = new FloatArray();
    flatPixelArray = new float[width * height * 3];

    for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
            float r = pixels[y][x][0];
            float g = pixels[y][x][1];
            float b = pixels[y][x][2];

            floats.addAll(r, g, b);
        }
    }

    for (int i = 0; i < floats.size; i++) {
        flatPixelArray[i] = floats.get(i);
    }

    floats.clear();

    return flatPixelArray;
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:23,代码来源:HDRData.java

示例2: debugRender

import com.badlogic.gdx.utils.FloatArray; //导入方法依赖的package包/类
/** Draws a polygon, using ray start and end points as vertices */
public void debugRender (PolygonShapeRenderer shapeRenderer) {
	shapeRenderer.setColor(Color.BLUE);
	FloatArray vertices = Pools.obtain(FloatArray.class);
	vertices.clear();
	for (int i = 0; i < rayNum; i++) {
		vertices.addAll(mx[i], my[i]);
	}
	for (int i = rayNum - 1; i > -1; i--) {
		vertices.addAll(startX[i], startY[i]);
	}
	vertices.add(vertices.get(0));
	vertices.add(vertices.get(1));
	shapeRenderer.polyline(vertices.shrink());
	Pools.free(vertices);
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:17,代码来源:RavChainLight.java

示例3: debugRender

import com.badlogic.gdx.utils.FloatArray; //导入方法依赖的package包/类
/**
 * Draws a polygon, using ray start and end points as vertices
 */
public void debugRender(ShapeRenderer shapeRenderer) {
	shapeRenderer.setColor(Color.YELLOW);
	FloatArray vertices = Pools.obtain(FloatArray.class);
	vertices.clear();
	for (int i = 0; i < rayNum; i++) {
		vertices.addAll(mx[i], my[i]);
	}
	for (int i = rayNum - 1; i > -1; i--) {
		vertices.addAll(startX[i], startY[i]);
	}
	shapeRenderer.polygon(vertices.shrink());
	Pools.free(vertices);
}
 
开发者ID:bitbrain,项目名称:rbcgj-2016,代码行数:17,代码来源:ChainLight.java

示例4: contains

import com.badlogic.gdx.utils.FloatArray; //导入方法依赖的package包/类
@Override
public boolean contains(float x, float y) {
	// fast fail
	if (!this.chainLightBounds.contains(x, y))
		return false;
	// actual check
	FloatArray vertices = Pools.obtain(FloatArray.class);
	vertices.clear();
	
	for (int i = 0; i < rayNum; i++) {
		vertices.addAll(mx[i], my[i]);
	}
	for (int i = rayNum - 1; i > -1; i--) {
		vertices.addAll(startX[i], startY[i]);
	}
	
	int intersects = 0;
	for (int i = 0; i < vertices.size; i += 2) {
		float x1 = vertices.items[i];
		float y1 = vertices.items[i + 1];
		float x2 = vertices.items[(i + 2) % vertices.size];
		float y2 = vertices.items[(i + 3) % vertices.size];
		if (((y1 <= y && y < y2) || (y2 <= y && y < y1)) &&
				x < ((x2 - x1) / (y2 - y1) * (y - y1) + x1))
			intersects++;
	}
	boolean result = (intersects & 1) == 1;

	Pools.free(vertices);
	return result;
}
 
开发者ID:bitbrain,项目名称:rbcgj-2016,代码行数:32,代码来源:ChainLight.java

示例5: contains

import com.badlogic.gdx.utils.FloatArray; //导入方法依赖的package包/类
@Override
public boolean contains (float x, float y) {
	// fast fail
	if (!this.chainLightBounds.contains(x, y))
		return false;
	// actual check
	FloatArray vertices = Pools.obtain(FloatArray.class);
	vertices.clear();

	for (int i = 0; i < rayNum; i++) {
		vertices.addAll(mx[i], my[i]);
	}
	for (int i = rayNum - 1; i > -1; i--) {
		vertices.addAll(startX[i], startY[i]);
	}

	int intersects = 0;
	for (int i = 0; i < vertices.size; i += 2) {
		float x1 = vertices.items[i];
		float y1 = vertices.items[i + 1];
		float x2 = vertices.items[(i + 2) % vertices.size];
		float y2 = vertices.items[(i + 3) % vertices.size];
		if (((y1 <= y && y < y2) || (y2 <= y && y < y1)) && x < ((x2 - x1) / (y2 - y1) * (y - y1) + x1))
			intersects++;
	}
	boolean result = (intersects & 1) == 1;

	Pools.free(vertices);
	return result;
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:31,代码来源:RavChainLight.java


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