@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Vertex other = (Vertex) obj; if (this.v != other.v && (this.v == null || !this.v.equals(other.v))) { return false; } if (this.vt != other.vt && (this.vt == null || !this.vt.equals(other.vt))) { return false; } if (this.vn != other.vn && (this.vn == null || !this.vn.equals(other.vn))) { return false; } return true; }
return -1; if (!uvs.get(i).equals(entry.getValue())) { return -1;
/** * Checks to see if the given Vector2f is equals to the data stored in the * buffer at the given data index. * * @param check * the vector to check against - null will return false. * @param buf * the buffer to compare data with * @param index * the position (in terms of vectors, not floats) of the vector * in the buffer to check against * @return true if the data is equivalent, otherwise false. */ public static boolean equals(Vector2f check, FloatBuffer buf, int index) { TempVars vars = TempVars.get(); Vector2f tempVec2 = vars.vect2d; populateFromBuffer(tempVec2, buf, index); boolean eq = tempVec2.equals(check); vars.release(); return eq; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Vertex other = (Vertex) obj; if (this.v != other.v && (this.v == null || !this.v.equals(other.v))) { return false; } if (this.vt != other.vt && (this.vt == null || !this.vt.equals(other.vt))) { return false; } if (this.vn != other.vn && (this.vn == null || !this.vn.equals(other.vn))) { return false; } return true; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Vertex other = (Vertex) obj; if (this.v != other.v && (this.v == null || !this.v.equals(other.v))) { return false; } if (this.vt != other.vt && (this.vt == null || !this.vt.equals(other.vt))) { return false; } if (this.vn != other.vn && (this.vn == null || !this.vn.equals(other.vn))) { return false; } return true; }
public void setIconScale( Vector2f scale ) { if( this.iconScale.equals(scale) ) return; this.iconScale.set(scale); // Not very efficient createIcon(); invalidate(); }
/** * Checks to see if the given Vector2f is equals to the data stored in the * buffer at the given data index. * * @param check * the vector to check against - null will return false. * @param buf * the buffer to compare data with * @param index * the position (in terms of vectors, not floats) of the vector * in the buffer to check against * @return true if the data is equivalent, otherwise false. */ public static boolean equals(Vector2f check, FloatBuffer buf, int index) { TempVars vars = TempVars.get(); Vector2f tempVec2 = vars.vect2d; populateFromBuffer(tempVec2, buf, index); boolean eq = tempVec2.equals(check); vars.release(); return eq; }
/** * Checks to see if the given Vector2f is equals to the data stored in the * buffer at the given data index. * * @param check * the vector to check against - null will return false. * @param buf * the buffer to compare data with * @param index * the position (in terms of vectors, not floats) of the vector * in the buffer to check against * @return */ public static boolean equals(Vector2f check, FloatBuffer buf, int index) { TempVars vars = TempVars.get(); Vector2f tempVec2 = vars.vect2d; populateFromBuffer(tempVec2, buf, index); boolean eq = tempVec2.equals(check); vars.release(); return eq; }
/** Removes duplicate and unindexed vertex, uv, normals if it can. lossless*/ public MeshData removeDuplicateData() { short[] returnedIndexArray = this.getIndexArrayCopy(); ArrayList<Vector3f> vertex = new ArrayList<Vector3f>(); for (int i = 0; i < getNumberOfVertexElements(); i++) { vertex.add(getVertex(i)); } for (int i = 0; i < getNumberOfVertexElements(); i++) { Vector3f vi = vertex.get(i); for (int j = i + 1; j < getNumberOfVertexElements(); j++) { Vector3f vj = vertex.get(j); if (vi.equals(vj) && getNormal(i).equals(getNormal(j)) && getUv(i).equals(getUv(j))) { returnedIndexArray[j] = (short) i; } } } MeshData returned = this.shallowClone(); returned.indexArray = returnedIndexArray; returned = returned.compress(); return returned; }
/** Removes duplicate and unindexed vertex, uv, normals if it can. lossless*/ public MeshData removeDuplicateData() { short[] returnedIndexArray = this.getIndexArrayCopy(); ArrayList<Vector3f> vertex = new ArrayList<Vector3f>(); for (int i = 0; i < getNumberOfVertexElements(); i++) { vertex.add(getVertex(i)); } for (int i = 0; i < getNumberOfVertexElements(); i++) { Vector3f vi = vertex.get(i); for (int j = i + 1; j < getNumberOfVertexElements(); j++) { Vector3f vj = vertex.get(j); if (vi.equals(vj) && getNormal(i).equals(getNormal(j)) && getUv(i).equals(getUv(j))) { returnedIndexArray[j] = (short) i; } } } MeshData returned = this.shallowClone(); returned.indexArray = returnedIndexArray; returned = returned.compress(); return returned; }
public void update(float tpf) { synchronized (MovieMaterial.this) { if (latestFrame != null && latestFrame != jmeFrame) { if (!aspectValues.equals(material.getParam("AspectValues").getValue())) { material.setVector2("AspectValues", aspectValues.clone()); } if (!validRange.equals(material.getParam("ValidRange").getValue())) { material.setVector2("ValidRange", validRange.clone()); } if (noFrame) { noFrame = false; material.setBoolean("NoFrame", noFrame); } updateTexture(textureLuma, latestFrame.getBufferForPlane(TgqFrame.YCBCR_PLANE_LUMA), latestFrame.getLinesize(TgqFrame.YCBCR_PLANE_LUMA)); updateTexture(textureCr, latestFrame.getBufferForPlane(TgqFrame.YCBCR_PLANE_CR), latestFrame.getLinesize(TgqFrame.YCBCR_PLANE_CR)); updateTexture(textureCb, latestFrame.getBufferForPlane(TgqFrame.YCBCR_PLANE_CB), latestFrame.getLinesize(TgqFrame.YCBCR_PLANE_CB)); jmeFrame = latestFrame; } } }
public boolean update(Vector2f mousePosition) { Camera cam = app.getCamera(); Vector3f pos = cam.getLocation(); if (cameraPosition.equals(pos) && this.mousePosition.equals(mousePosition)) { return false; } cameraPosition.set(pos); this.mousePosition.set(mousePosition); Vector3f tmp = cam.getWorldCoordinates(this.mousePosition, 0f).clone(); Vector3f dir = cam.getWorldCoordinates(this.mousePosition, 1f).subtractLocal(tmp).normalizeLocal(); dir.multLocal((MapLoader.TOP_HEIGHT - pos.getY()) / dir.getY()).addLocal(pos); pointedPosition.set(dir.getX(), dir.getZ()); pointedTileIndex = WorldUtils.vectorToPoint(pointedPosition); pointedTilePosition = WorldUtils.pointToVector2f(pointedTileIndex); setPos(pointedTilePosition); return true; }
if( !appliedTextureScale.equals(effectiveScale) ) {