Package org.joml
Class Vector2f
java.lang.Object
org.joml.Vector2f
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,Vector2fc
public class Vector2f extends java.lang.Object implements java.io.Externalizable, Vector2fc
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Vector2f
add(float x, float y)
Vector2f
add(float x, float y, Vector2f dest)
Vector2f
add(Vector2fc v)
Vector2f
add(Vector2fc v, Vector2f dest)
float
angle(Vector2fc v)
float
distance(float x, float y)
float
distance(Vector2fc v)
float
distanceSquared(float x, float y)
float
distanceSquared(Vector2fc v)
float
dot(Vector2fc v)
boolean
equals(java.lang.Object obj)
Vector2f
fma(float a, Vector2fc b)
Vector2f
fma(float a, Vector2fc b, Vector2f dest)
Vector2f
fma(Vector2fc a, Vector2fc b)
Vector2f
fma(Vector2fc a, Vector2fc b, Vector2f dest)
java.nio.ByteBuffer
get(int index, java.nio.ByteBuffer buffer)
java.nio.FloatBuffer
get(int index, java.nio.FloatBuffer buffer)
java.nio.ByteBuffer
get(java.nio.ByteBuffer buffer)
java.nio.FloatBuffer
get(java.nio.FloatBuffer buffer)
int
hashCode()
float
length()
float
lengthSquared()
Vector2f
lerp(Vector2fc other, float t)
Vector2f
lerp(Vector2fc other, float t, Vector2f dest)
Vector2f
mul(float scalar)
Vector2f
mul(float x, float y)
Vector2f
mul(float x, float y, Vector2f dest)
Vector2f
mul(float scalar, Vector2f dest)
Vector2f
mul(Vector2fc v)
Vector2f
mul(Vector2fc v, Vector2f dest)
Vector2f
negate()
Vector2f
negate(Vector2f dest)
Vector2f
normalize()
Vector2f
normalize(Vector2f dest)
Vector2f
perpendicular()
void
readExternal(java.io.ObjectInput in)
Vector2f
set(float d)
Vector2f
set(float x, float y)
Vector2f
set(int index, java.nio.ByteBuffer buffer)
Vector2f
set(int index, java.nio.FloatBuffer buffer)
Vector2f
set(java.nio.ByteBuffer buffer)
Vector2f
set(java.nio.FloatBuffer buffer)
Vector2f
set(Vector2dc v)
Vector2f
set(Vector2fc v)
Vector2f
setComponent(int component, float value)
Vector2f
sub(float x, float y)
Vector2f
sub(float x, float y, Vector2f dest)
Vector2f
sub(Vector2fc v)
Vector2f
sub(Vector2fc v, Vector2f dest)
Vector2fc
toImmutable()
java.lang.String
toString()
java.lang.String
toString(java.text.NumberFormat formatter)
void
writeExternal(java.io.ObjectOutput out)
float
x()
float
y()
Vector2f
zero()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
x
public float x -
y
public float y
-
-
Constructor Details
-
Vector2f
public Vector2f() -
Vector2f
public Vector2f(float d) -
Vector2f
public Vector2f(float x, float y) -
Vector2f
-
Vector2f
public Vector2f(java.nio.ByteBuffer buffer) -
Vector2f
public Vector2f(int index, java.nio.ByteBuffer buffer) -
Vector2f
public Vector2f(java.nio.FloatBuffer buffer) -
Vector2f
public Vector2f(int index, java.nio.FloatBuffer buffer)
-
-
Method Details
-
x
public float x() -
y
public float y() -
set
-
set
-
set
-
set
-
set
-
set
-
set
-
set
-
setComponent
- 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.FloatBuffer get(java.nio.FloatBuffer buffer) -
get
public java.nio.FloatBuffer get(int index, java.nio.FloatBuffer buffer) -
perpendicular
-
sub
-
sub
-
sub
-
sub
-
dot
-
angle
-
length
public float length() -
lengthSquared
public float lengthSquared()- Specified by:
lengthSquared
in interfaceVector2fc
-
distance
-
distanceSquared
- Specified by:
distanceSquared
in interfaceVector2fc
-
distance
public float distance(float x, float y) -
distanceSquared
public float distanceSquared(float x, float y)- Specified by:
distanceSquared
in interfaceVector2fc
-
normalize
-
normalize
-
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
-
mul
-
mul
-
mul
-
mul
-
mul
-
mul
-
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
-