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 Vector2fadd(float x, float y)Vector2fadd(float x, float y, Vector2f dest)Vector2fadd(Vector2fc v)Vector2fadd(Vector2fc v, Vector2f dest)floatangle(Vector2fc v)floatdistance(float x, float y)floatdistance(Vector2fc v)floatdistanceSquared(float x, float y)floatdistanceSquared(Vector2fc v)floatdot(Vector2fc v)booleanequals(java.lang.Object obj)Vector2ffma(float a, Vector2fc b)Vector2ffma(float a, Vector2fc b, Vector2f dest)Vector2ffma(Vector2fc a, Vector2fc b)Vector2ffma(Vector2fc a, Vector2fc b, Vector2f dest)java.nio.ByteBufferget(int index, java.nio.ByteBuffer buffer)java.nio.FloatBufferget(int index, java.nio.FloatBuffer buffer)java.nio.ByteBufferget(java.nio.ByteBuffer buffer)java.nio.FloatBufferget(java.nio.FloatBuffer buffer)inthashCode()floatlength()floatlengthSquared()Vector2flerp(Vector2fc other, float t)Vector2flerp(Vector2fc other, float t, Vector2f dest)Vector2fmul(float scalar)Vector2fmul(float x, float y)Vector2fmul(float x, float y, Vector2f dest)Vector2fmul(float scalar, Vector2f dest)Vector2fmul(Vector2fc v)Vector2fmul(Vector2fc v, Vector2f dest)Vector2fnegate()Vector2fnegate(Vector2f dest)Vector2fnormalize()Vector2fnormalize(Vector2f dest)Vector2fperpendicular()voidreadExternal(java.io.ObjectInput in)Vector2fset(float d)Vector2fset(float x, float y)Vector2fset(int index, java.nio.ByteBuffer buffer)Vector2fset(int index, java.nio.FloatBuffer buffer)Vector2fset(java.nio.ByteBuffer buffer)Vector2fset(java.nio.FloatBuffer buffer)Vector2fset(Vector2dc v)Vector2fset(Vector2fc v)Vector2fsetComponent(int component, float value)Vector2fsub(float x, float y)Vector2fsub(float x, float y, Vector2f dest)Vector2fsub(Vector2fc v)Vector2fsub(Vector2fc v, Vector2f dest)Vector2fctoImmutable()java.lang.StringtoString()java.lang.StringtoString(java.text.NumberFormat formatter)voidwriteExternal(java.io.ObjectOutput out)floatx()floaty()Vector2fzero()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:
lengthSquaredin interfaceVector2fc
-
distance
-
distanceSquared
- Specified by:
distanceSquaredin interfaceVector2fc
-
distance
public float distance(float x, float y) -
distanceSquared
public float distanceSquared(float x, float y)- Specified by:
distanceSquaredin interfaceVector2fc
-
normalize
-
normalize
-
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
-
mul
-
mul
-
mul
-
mul
-
mul
-
mul
-
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
-