|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright (c) 2009-2018 jMonkeyEngine |
|
|
|
* Copyright (c) 2009-2019 jMonkeyEngine |
|
|
|
* All rights reserved. |
|
|
|
* All rights reserved. |
|
|
|
* |
|
|
|
* |
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
@ -875,6 +875,29 @@ public final class Vector4f implements Savable, Cloneable, java.io.Serializable |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns true if this vector is similar to the specified vector within |
|
|
|
|
|
|
|
* some value of epsilon. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isSimilar(Vector4f other, float epsilon) { |
|
|
|
|
|
|
|
if (other == null) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Float.compare(Math.abs(other.x - x), epsilon) > 0) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Float.compare(Math.abs(other.y - y), epsilon) > 0) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Float.compare(Math.abs(other.z - z), epsilon) > 0) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Float.compare(Math.abs(other.w - w), epsilon) > 0) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <code>hashCode</code> returns a unique code for this vector object based |
|
|
|
* <code>hashCode</code> returns a unique code for this vector object based |
|
|
|
* on its values. If two vectors are logically equivalent, they will return |
|
|
|
* on its values. If two vectors are logically equivalent, they will return |
|
|
|