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 Vector2dadd(double x, double y)Vector2dadd(double x, double y, Vector2d dest)Vector2dadd(Vector2dc v)Vector2dadd(Vector2dc v, Vector2d dest)Vector2dadd(Vector2fc v)Vector2dadd(Vector2fc v, Vector2d dest)doubleangle(Vector2dc v)doubledistance(double x, double y)doubledistance(Vector2dc v)doubledistance(Vector2fc v)doubledot(Vector2dc v)booleanequals(java.lang.Object obj)Vector2dfma(double a, Vector2dc b)Vector2dfma(double a, Vector2dc b, Vector2d dest)Vector2dfma(Vector2dc a, Vector2dc b)Vector2dfma(Vector2dc a, Vector2dc b, Vector2d dest)java.nio.ByteBufferget(int index, java.nio.ByteBuffer buffer)java.nio.DoubleBufferget(int index, java.nio.DoubleBuffer buffer)java.nio.ByteBufferget(java.nio.ByteBuffer buffer)java.nio.DoubleBufferget(java.nio.DoubleBuffer buffer)inthashCode()doublelength()Vector2dlerp(Vector2dc other, double t)Vector2dlerp(Vector2dc other, double t, Vector2d dest)Vector2dmul(double scalar)Vector2dmul(double x, double y)Vector2dmul(double x, double y, Vector2d dest)Vector2dmul(double scalar, Vector2d dest)Vector2dmul(Vector2dc v)Vector2dmul(Vector2dc v, Vector2d dest)Vector2dnegate()Vector2dnegate(Vector2d dest)Vector2dnormalize()Vector2dnormalize(Vector2d dest)Vector2dperpendicular()voidreadExternal(java.io.ObjectInput in)Vector2dset(double d)Vector2dset(double x, double y)Vector2dset(int index, java.nio.ByteBuffer buffer)Vector2dset(int index, java.nio.DoubleBuffer buffer)Vector2dset(java.nio.ByteBuffer buffer)Vector2dset(java.nio.DoubleBuffer buffer)Vector2dset(Vector2dc v)Vector2dset(Vector2fc v)Vector2dsetComponent(int component, double value)Vector2dsub(double x, double y)Vector2dsub(double x, double y, Vector2d dest)Vector2dsub(Vector2dc v)Vector2dsub(Vector2dc v, Vector2d dest)Vector2dsub(Vector2fc v)Vector2dsub(Vector2fc v, Vector2d dest)Vector2dctoImmutable()java.lang.StringtoString()java.lang.StringtoString(java.text.NumberFormat formatter)voidwriteExternal(java.io.ObjectOutput out)doublex()doubley()Vector2dzero()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:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
negate
-
negate
-
lerp
-
lerp
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(java.text.NumberFormat formatter) -
fma
-
fma
-
fma
-
fma
-
toImmutable
-