Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector2f: added final static variables NAN, UNIT_X, UNIT_Y, … #2198

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions jme3-core/src/main/java/com/jme3/math/Vector2f.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,34 @@ public final class Vector2f implements Savable, Cloneable, java.io.Serializable
* Shared instance of the all-zero vector (0,0). Do not modify!
*/
public static final Vector2f ZERO = new Vector2f(0f, 0f);
/**
* Shared instance of the all-NaN vector (NaN,NaN). Do not modify!
*/
public static final Vector2f NAN = new Vector2f(Float.NaN, Float.NaN);
/**
* Shared instance of the +X direction (1,0). Do not modify!
*/
public static final Vector2f UNIT_X = new Vector2f(1, 0);
/**
* Shared instance of the +Y direction (0,1). Do not modify!
*/
public static final Vector2f UNIT_Y = new Vector2f(0, 1);
/**
* Shared instance of the all-ones vector (1,1). Do not modify!
*/
public static final Vector2f UNIT_XY = new Vector2f(1f, 1f);
/**
* Shared instance of the all-plus-infinity vector (+Inf,+Inf). Do not modify!
*/
public static final Vector2f POSITIVE_INFINITY = new Vector2f(
Float.POSITIVE_INFINITY,
Float.POSITIVE_INFINITY);
/**
* Shared instance of the all-negative-infinity vector (-Inf,-Inf). Do not modify!
*/
public static final Vector2f NEGATIVE_INFINITY = new Vector2f(
Float.NEGATIVE_INFINITY,
Float.NEGATIVE_INFINITY);
/**
* The first (X) component.
*/
Expand Down
Loading