private boolean equalTo(JCameraRotationCoefficientsMutable another) { double horizontal = horizontal(); double vertical = vertical(); return Double.doubleToLongBits(horizontal) == Double.doubleToLongBits(another.horizontal()) && Double.doubleToLongBits(vertical) == Double.doubleToLongBits(another.vertical()); }
/** * Generates a string representation of this {@code JCameraRotationCoefficientsType}. * If uninitialized, some attribute values may appear as question marks. * @return A string representation */ @Override public String toString() { return "JCameraRotationCoefficientsMutable{" + "horizontal=" + horizontal() + ", vertical=" + vertical() + "}"; } }
/** * Computes a hash code from attributes: {@code horizontal}, {@code vertical}. * @return hashCode value */ @Override public int hashCode() { int h = 5381; double horizontal = horizontal(); h += (h << 5) + java.lang.Double.hashCode(horizontal); double vertical = vertical(); h += (h << 5) + java.lang.Double.hashCode(vertical); return h; }
@Override public void mouseMoved( final @Nullable MouseEvent e) { assert e != null; /* * If the camera is enabled, get the rotation coefficients for the mouse * movement. */ if (this.sim.cameraIsEnabled()) { this.rotations.from( this.mouse_region.get().coefficients( (double) e.getX(), (double) e.getY())); this.input.addRotationAroundHorizontal(this.rotations.horizontal()); this.input.addRotationAroundVertical(this.rotations.vertical()); } } }