Added to phys2d Vector2f (copied from Slick's Vector2f implementation):
Code:
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object other)
{
if (other == null) return false;
if (other == this) return true;
if (other instanceof Vector2f) {
Vector2f o = ((Vector2f) other);
return (o.x == x) && (o.y == y);
}
return false;
}
/**
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return 997 * ((int)x) ^ 991 * ((int)y); //large primes!
}
...Would be nice if this were included in phys2d, so I don't have to keep it in a separate repository.
