Some android sync

This commit is contained in:
codeanticode
2012-04-16 19:18:32 +00:00
parent a341e4466f
commit 3270b1dc85
2 changed files with 68 additions and 1 deletions
@@ -838,7 +838,7 @@ public class PGraphics extends PImage implements PConstants {
if (which > 0) {
return hints[which];
} else {
return hints[-which];
return !hints[-which];
}
}
@@ -1161,7 +1161,18 @@ public class PShape implements PConstants {
return vertices[index];
}
public PVector getVertex(int index, PVector vec) {
if (vec == null) {
vec = new PVector();
}
vec.x = vertices[index][X];
vec.y = vertices[index][Y];
vec.z = vertices[index][Z];
return vec;
}
public float getVertexX(int index) {
return vertices[index][X];
}
@@ -1176,6 +1187,62 @@ public class PShape implements PConstants {
return vertices[index][Z];
}
public void setVertex(int index, float x, float y, float z) {
vertices[index][X] = x;
vertices[index][Y] = y;
vertices[index][Z] = z;
}
public PVector getNormal(int index, PVector vec) {
if (vec == null) {
vec = new PVector();
}
vec.x = vertices[index][NX];
vec.y = vertices[index][NY];
vec.z = vertices[index][NZ];
return vec;
}
public float getNormalX(int index) {
return vertices[index][NX];
}
public float getNormalY(int index) {
return vertices[index][NY];
}
public float getNormalZ(int index) {
return vertices[index][NZ];
}
public void setNormal(int index, float nx, float ny, float nz) {
vertices[index][NX] = nx;
vertices[index][NY] = ny;
vertices[index][NZ] = nz;
}
public PVector getVertexUV(int index, PVector vec) {
if (vec == null) {
vec = new PVector();
}
vec.x = vertices[index][U];
vec.y = vertices[index][V];
return vec;
}
public float getVertexU(int index) {
return vertices[index][U];
}
public float getVertexV(int index) {
return vertices[index][V];
}
public void setVertexUV(int index, float u, float v) {
vertices[index][U] = u;
vertices[index][V] = v;
}
public int[] getVertexCodes() {
if (vertexCodes == null) {