Skip to content

Commit d0683ed

Browse files
authored
Vector2f: added final static variables NAN, UNIT_X, UNIT_Y, POS_INF, NEG_INF (#2198)
Vector2f: added final static variables: * Vector2f.NAN * Vector2f.UNIT_X * Vector2f.UNIT_Y * Vector2f.POS_INF * Vector2f.NEG_INF
1 parent 56fecab commit d0683ed

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

jme3-core/src/main/java/com/jme3/math/Vector2f.java

+24
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,34 @@ public final class Vector2f implements Savable, Cloneable, java.io.Serializable
5454
* Shared instance of the all-zero vector (0,0). Do not modify!
5555
*/
5656
public static final Vector2f ZERO = new Vector2f(0f, 0f);
57+
/**
58+
* Shared instance of the all-NaN vector (NaN,NaN). Do not modify!
59+
*/
60+
public static final Vector2f NAN = new Vector2f(Float.NaN, Float.NaN);
61+
/**
62+
* Shared instance of the +X direction (1,0). Do not modify!
63+
*/
64+
public static final Vector2f UNIT_X = new Vector2f(1, 0);
65+
/**
66+
* Shared instance of the +Y direction (0,1). Do not modify!
67+
*/
68+
public static final Vector2f UNIT_Y = new Vector2f(0, 1);
5769
/**
5870
* Shared instance of the all-ones vector (1,1). Do not modify!
5971
*/
6072
public static final Vector2f UNIT_XY = new Vector2f(1f, 1f);
73+
/**
74+
* Shared instance of the all-plus-infinity vector (+Inf,+Inf). Do not modify!
75+
*/
76+
public static final Vector2f POSITIVE_INFINITY = new Vector2f(
77+
Float.POSITIVE_INFINITY,
78+
Float.POSITIVE_INFINITY);
79+
/**
80+
* Shared instance of the all-negative-infinity vector (-Inf,-Inf). Do not modify!
81+
*/
82+
public static final Vector2f NEGATIVE_INFINITY = new Vector2f(
83+
Float.NEGATIVE_INFINITY,
84+
Float.NEGATIVE_INFINITY);
6185
/**
6286
* The first (X) component.
6387
*/

0 commit comments

Comments
 (0)