本文整理汇总了Java中org.andengine.entity.primitive.Mesh.VERTEX_SIZE属性的典型用法代码示例。如果您正苦于以下问题:Java Mesh.VERTEX_SIZE属性的具体用法?Java Mesh.VERTEX_SIZE怎么用?Java Mesh.VERTEX_SIZE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.andengine.entity.primitive.Mesh
的用法示例。
在下文中一共展示了Mesh.VERTEX_SIZE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdateColor
@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();
}
示例2: onUpdateColor
@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();
}
示例3: setRadius
/**
*
* @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;
}
示例4: updateVertexList
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];
}
}