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


Java Mesh类代码示例

本文整理汇总了Java中org.andengine.entity.primitive.Mesh的典型用法代码示例。如果您正苦于以下问题:Java Mesh类的具体用法?Java Mesh怎么用?Java Mesh使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onUpdateColor

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
@Override
public void onUpdateColor(final Mesh pMesh) {
	final float[] bufferData = this.mBufferData;

	final float packedColor = pMesh.getColor().getABGRPackedFloat();

	for (int i = 0; i < this.mVertexCount; i++) {
		bufferData[(i * Mesh.VERTEX_SIZE) + Mesh.COLOR_INDEX] = packedColor;
	}

	this.setDirtyOnHardware();
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:13,代码来源:HighPerformanceMeshVertexBufferObject.java

示例2: onUpdateColor

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
@Override
public void onUpdateColor(final Mesh pMesh) {
	final float[] bufferData = this.mBufferData;

	final float packedColor = pMesh.getColor().getABGRPackedFloat();

	for(int i = 0; i < this.mVertexCount; i++) {
		bufferData[(i * Mesh.VERTEX_SIZE) + Mesh.COLOR_INDEX] = packedColor;
	}

	this.setDirtyOnHardware();
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:13,代码来源:HighPerformanceMeshVertexBufferObject.java

示例3: setRadius

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
/**
 * 
 * @param pRadiusA
 * @param pRadiusB
 * @return 	true if vertices were correctly updated
 * 			false otherwise
 */
/*
public boolean setRadius( float pRadiusA, float pRadiusB )
{
	return this.updateVertices(buildEllipseVertices(pRadiusA, pRadiusB, mResolution));
}
*/

// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================

// ===========================================================
// Methods
// ===========================================================

private static float[] buildEllipseVertices(float pRadiusA, float pRadiusB, int pResolution) {

	float[] vertices = new float[VERTEX_SIZE * pResolution];
	
	for( int i = 0; i < pResolution; i++)
	{
		double theta = 2. * Math.PI * (double)i / (double) pResolution;
		float x = (float) ( (double)pRadiusA * Math.cos( theta ));
		float y = (float) ( (double)pRadiusB * Math.sin( theta ));
		
		vertices[(i * Mesh.VERTEX_SIZE) + Mesh.VERTEX_INDEX_X] = x;
		vertices[(i * Mesh.VERTEX_SIZE) + Mesh.VERTEX_INDEX_Y] = y;
	}
			
	return vertices;
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:39,代码来源:Ellipse.java

示例4: updateVertexList

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
protected static void updateVertexList(float[] pVertexX, float[] pVertexY,
		float[] pBufferData) {
	for (int i = 0; i < pVertexX.length; i++) {
		pBufferData[(i * Mesh.VERTEX_SIZE) + Mesh.VERTEX_INDEX_X] = pVertexX[i];
		pBufferData[(i * Mesh.VERTEX_SIZE) + Mesh.VERTEX_INDEX_Y] = pVertexY[i];
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:8,代码来源:PolyLine.java

示例5: onUpdateVertices

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
@Override
public void onUpdateVertices(final Mesh pMesh) {
	/* Since the buffer data is managed from the caller, we just mark the buffer data as dirty. */

	this.setDirtyOnHardware();
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:7,代码来源:HighPerformanceMeshVertexBufferObject.java

示例6: onUpdateColor

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
public void onUpdateColor(final Mesh pMesh); 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:2,代码来源:IMeshVertexBufferObject.java

示例7: onUpdateVertices

import org.andengine.entity.primitive.Mesh; //导入依赖的package包/类
public void onUpdateVertices(final Mesh pMesh); 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:2,代码来源:IMeshVertexBufferObject.java


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