Package org.joml
Class Vector2d
java.lang.Object
org.joml.Vector2d
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,Vector2dc
public class Vector2d extends java.lang.Object implements java.io.Externalizable, Vector2dc
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Vector2d()
Vector2d(double d)
Vector2d(double x, double y)
Vector2d(int index, java.nio.ByteBuffer buffer)
Vector2d(int index, java.nio.DoubleBuffer buffer)
Vector2d(java.nio.ByteBuffer buffer)
Vector2d(java.nio.DoubleBuffer buffer)
Vector2d(Vector2dc v)
Vector2d(Vector2fc v)
-
Method Summary
Modifier and Type Method Description Vector2d
add(double x, double y)
Vector2d
add(double x, double y, Vector2d dest)
Vector2d
add(Vector2dc v)
Vector2d
add(Vector2dc v, Vector2d dest)
Vector2d
add(Vector2fc v)
Vector2d
add(Vector2fc v, Vector2d dest)
double
angle(Vector2dc v)
double
distance(double x, double y)
double
distance(Vector2dc v)
double
distance(Vector2fc v)
double
dot(Vector2dc v)
boolean
equals(java.lang.Object obj)
Vector2d
fma(double a, Vector2dc b)
Vector2d
fma(double a, Vector2dc b, Vector2d dest)
Vector2d
fma(Vector2dc a, Vector2dc b)
Vector2d
fma(Vector2dc a, Vector2dc b, Vector2d dest)
java.nio.ByteBuffer
get(int index, java.nio.ByteBuffer buffer)
java.nio.DoubleBuffer
get(int index, java.nio.DoubleBuffer buffer)
java.nio.ByteBuffer
get(java.nio.ByteBuffer buffer)
java.nio.DoubleBuffer
get(java.nio.DoubleBuffer buffer)
int
hashCode()
double
length()
Vector2d
lerp(Vector2dc other, double t)
Vector2d
lerp(Vector2dc other, double t, Vector2d dest)
Vector2d
mul(double scalar)
Vector2d
mul(double x, double y)
Vector2d
mul(double x, double y, Vector2d dest)
Vector2d
mul(double scalar, Vector2d dest)
Vector2d
mul(Vector2dc v)
Vector2d
mul(Vector2dc v, Vector2d dest)
Vector2d
negate()
Vector2d
negate(Vector2d dest)
Vector2d
normalize()
Vector2d
normalize(Vector2d dest)
Vector2d
perpendicular()
void
readExternal(java.io.ObjectInput in)
Vector2d
set(double d)
Vector2d
set(double x, double y)
Vector2d
set(int index, java.nio.ByteBuffer buffer)
Vector2d
set(int index, java.nio.DoubleBuffer buffer)
Vector2d
set(java.nio.ByteBuffer buffer)
Vector2d
set(java.nio.DoubleBuffer buffer)
Vector2d
set(Vector2dc v)
Vector2d
set(Vector2fc v)
Vector2d
setComponent(int component, double value)
Vector2d
sub(double x, double y)
Vector2d
sub(double x, double y, Vector2d dest)
Vector2d
sub(Vector2dc v)
Vector2d
sub(Vector2dc v, Vector2d dest)
Vector2d
sub(Vector2fc v)
Vector2d
sub(Vector2fc v, Vector2d dest)
Vector2dc
toImmutable()
java.lang.String
toString()
java.lang.String
toString(java.text.NumberFormat formatter)
void
writeExternal(java.io.ObjectOutput out)
double
x()
double
y()
Vector2d
zero()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
x
public double x -
y
public double y
-
-
Constructor Details
-
Vector2d
public Vector2d() -
Vector2d
public Vector2d(double d) -
Vector2d
public Vector2d(double x, double y) -
Vector2d
-
Vector2d
-
Vector2d
public Vector2d(java.nio.ByteBuffer buffer) -
Vector2d
public Vector2d(int index, java.nio.ByteBuffer buffer) -
Vector2d
public Vector2d(java.nio.DoubleBuffer buffer) -
Vector2d
public Vector2d(int index, java.nio.DoubleBuffer buffer)
-
-
Method Details
-
x
public double x() -
y
public double y() -
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
setComponent
public Vector2d setComponent(int component, double value) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
get
public java.nio.ByteBuffer get(java.nio.ByteBuffer buffer) -
get
public java.nio.ByteBuffer get(int index, java.nio.ByteBuffer buffer) -
get
public java.nio.DoubleBuffer get(java.nio.DoubleBuffer buffer) -
get
public java.nio.DoubleBuffer get(int index, java.nio.DoubleBuffer buffer) -
perpendicular
-
sub
-
sub
-
sub
-
sub
-
sub
-
sub
-
mul
-
mul
-
mul
-
mul
-
mul
-
mul
-
dot
-
angle
-
length
public double length() -
distance
-
distance
-
distance
public double distance(double x, double y) -
normalize
-
normalize
-
add
-
add
-
add
-
add
-
add
-
add
-
zero
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
negate
-
negate
-
lerp
-
lerp
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.text.NumberFormat formatter) -
fma
-
fma
-
fma
-
fma
-
toImmutable
-