JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.math.Vec2i Class Reference

2D Vector based upon two integer components. More...

Collaboration diagram for com.jogamp.math.Vec2i:

Public Member Functions

 Vec2i ()
 
 Vec2i (final Vec2i o)
 
Vec2i copy ()
 
 Vec2i (final int[] xy)
 
 Vec2i (final int x, final int y)
 
void set (final Vec2i o)
 this = o, returns this. More...
 
void set (final int x, final int y)
 this = { x, y }, returns this. More...
 
Vec2i set (final int[] xy)
 this = xy, returns this. More...
 
Vec2i toArray (final int[] xy)
 xy[0..1] = this. More...
 
int[] get (final int[] xy)
 xy = this, returns xy. More...
 
int x ()
 
int y ()
 
void setX (final int x)
 
void setY (final int y)
 
boolean isZero ()
 Return true if all components are zero. More...
 
int length ()
 Return the length of this vector, a.k.a the norm or magnitude More...
 
int lengthSq ()
 Return the squared length of this vector, a.k.a the squared norm or squared magnitude More...
 
int distSq (final Vec2i o)
 Return the squared distance between this vector and the given one. More...
 
int dist (final Vec2i o)
 Return the distance between this vector and the given one. More...
 
boolean isEqual (final Vec2i o)
 Equals check. More...
 
boolean equals (final Object o)
 
String toString ()
 

Detailed Description

2D Vector based upon two integer components.

Definition at line 34 of file Vec2i.java.

Constructor & Destructor Documentation

◆ Vec2i() [1/4]

com.jogamp.math.Vec2i.Vec2i ( )

Definition at line 38 of file Vec2i.java.

Here is the caller graph for this function:

◆ Vec2i() [2/4]

com.jogamp.math.Vec2i.Vec2i ( final Vec2i  o)

Definition at line 40 of file Vec2i.java.

◆ Vec2i() [3/4]

com.jogamp.math.Vec2i.Vec2i ( final int[]  xy)

Definition at line 48 of file Vec2i.java.

◆ Vec2i() [4/4]

com.jogamp.math.Vec2i.Vec2i ( final int  x,
final int  y 
)

Definition at line 52 of file Vec2i.java.

Member Function Documentation

◆ copy()

Vec2i com.jogamp.math.Vec2i.copy ( )

Definition at line 44 of file Vec2i.java.

Here is the call graph for this function:

◆ dist()

int com.jogamp.math.Vec2i.dist ( final Vec2i  o)

Return the distance between this vector and the given one.

Definition at line 130 of file Vec2i.java.

Here is the call graph for this function:

◆ distSq()

int com.jogamp.math.Vec2i.distSq ( final Vec2i  o)

Return the squared distance between this vector and the given one.

When comparing the relative distance between two points it is usually sufficient to compare the squared distances, thus avoiding an expensive square root operation.

Definition at line 121 of file Vec2i.java.

Here is the caller graph for this function:

◆ equals()

boolean com.jogamp.math.Vec2i.equals ( final Object  o)

Definition at line 148 of file Vec2i.java.

Here is the call graph for this function:

◆ get()

int[] com.jogamp.math.Vec2i.get ( final int[]  xy)

xy = this, returns xy.

Definition at line 83 of file Vec2i.java.

◆ isEqual()

boolean com.jogamp.math.Vec2i.isEqual ( final Vec2i  o)

Equals check.

Parameters
ocomparison value
Returns
true if all components are equal

Definition at line 139 of file Vec2i.java.

Here is the caller graph for this function:

◆ isZero()

boolean com.jogamp.math.Vec2i.isZero ( )

Return true if all components are zero.

Definition at line 96 of file Vec2i.java.

◆ length()

int com.jogamp.math.Vec2i.length ( )

Return the length of this vector, a.k.a the norm or magnitude

Definition at line 103 of file Vec2i.java.

Here is the call graph for this function:

◆ lengthSq()

int com.jogamp.math.Vec2i.lengthSq ( )

Return the squared length of this vector, a.k.a the squared norm or squared magnitude

Definition at line 110 of file Vec2i.java.

Here is the caller graph for this function:

◆ set() [1/3]

void com.jogamp.math.Vec2i.set ( final int  x,
final int  y 
)

this = { x, y }, returns this.

Definition at line 63 of file Vec2i.java.

◆ set() [2/3]

Vec2i com.jogamp.math.Vec2i.set ( final int[]  xy)

this = xy, returns this.

Definition at line 69 of file Vec2i.java.

◆ set() [3/3]

void com.jogamp.math.Vec2i.set ( final Vec2i  o)

this = o, returns this.

Definition at line 57 of file Vec2i.java.

◆ setX()

void com.jogamp.math.Vec2i.setX ( final int  x)

Definition at line 92 of file Vec2i.java.

Here is the caller graph for this function:

◆ setY()

void com.jogamp.math.Vec2i.setY ( final int  y)

Definition at line 93 of file Vec2i.java.

Here is the caller graph for this function:

◆ toArray()

Vec2i com.jogamp.math.Vec2i.toArray ( final int[]  xy)

xy[0..1] = this.

{x, y}, returns this.

Definition at line 76 of file Vec2i.java.

◆ toString()

String com.jogamp.math.Vec2i.toString ( )

Definition at line 157 of file Vec2i.java.

◆ x()

int com.jogamp.math.Vec2i.x ( )

Definition at line 89 of file Vec2i.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ y()

int com.jogamp.math.Vec2i.y ( )

Definition at line 90 of file Vec2i.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: