Exemple #1
0
 Vertex(final VertexGeometry<?> owner, final int index, final Vector3 point) {
   this.owner = owner;
   this.index = index;
   this.point = point.clone();
   this.edges = new HashSet<Edge>();
   this.faces = new HashSet<Face<?, ?>>();
 }
Exemple #2
0
  public void updateMeanNormal() {
    final Vector3 normal = new Vector3(0, 0, 0);

    for (final IFace face : faces) {
      normal.addLocal(face.getMeanNormal());
    }
    final float len = normal.length();

    if (len < 1e-6) {
      normal.set(0, 0, 1);
    } else {
      normal.divideLocal(len);
    }

    this.meanNormal = normal;
  }
Exemple #3
0
  @Override
  public boolean equals(final Object obj) {
    if (obj == null) {
      return false;
    }
    if (obj == this) {
      return true;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }

    final Vertex castObj = (Vertex) obj;

    return index == castObj.index && smooth == castObj.smooth && point.equals(castObj.point);
  }