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 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

      public Vector2f​(Vector2fc v)
    • 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()
      Specified by:
      x in interface Vector2fc
    • y

      public float y()
      Specified by:
      y in interface Vector2fc
    • set

      public Vector2f set​(float d)
    • set

      public Vector2f set​(float x, float y)
    • set

      public Vector2f set​(Vector2fc v)
    • set

      public Vector2f set​(Vector2dc v)
    • set

      public Vector2f set​(java.nio.ByteBuffer buffer)
    • set

      public Vector2f set​(int index, java.nio.ByteBuffer buffer)
    • set

      public Vector2f set​(java.nio.FloatBuffer buffer)
    • set

      public Vector2f set​(int index, java.nio.FloatBuffer buffer)
    • setComponent

      public Vector2f setComponent​(int component, float value) throws java.lang.IllegalArgumentException
      Throws:
      java.lang.IllegalArgumentException
    • get

      public java.nio.ByteBuffer get​(java.nio.ByteBuffer buffer)
      Specified by:
      get in interface Vector2fc
    • get

      public java.nio.ByteBuffer get​(int index, java.nio.ByteBuffer buffer)
      Specified by:
      get in interface Vector2fc
    • get

      public java.nio.FloatBuffer get​(java.nio.FloatBuffer buffer)
      Specified by:
      get in interface Vector2fc
    • get

      public java.nio.FloatBuffer get​(int index, java.nio.FloatBuffer buffer)
      Specified by:
      get in interface Vector2fc
    • perpendicular

      public Vector2f perpendicular()
    • sub

      public Vector2f sub​(Vector2fc v)
    • sub

      public Vector2f sub​(Vector2fc v, Vector2f dest)
      Specified by:
      sub in interface Vector2fc
    • sub

      public Vector2f sub​(float x, float y)
    • sub

      public Vector2f sub​(float x, float y, Vector2f dest)
      Specified by:
      sub in interface Vector2fc
    • dot

      public float dot​(Vector2fc v)
      Specified by:
      dot in interface Vector2fc
    • angle

      public float angle​(Vector2fc v)
      Specified by:
      angle in interface Vector2fc
    • length

      public float length()
      Specified by:
      length in interface Vector2fc
    • lengthSquared

      public float lengthSquared()
      Specified by:
      lengthSquared in interface Vector2fc
    • distance

      public float distance​(Vector2fc v)
      Specified by:
      distance in interface Vector2fc
    • distanceSquared

      public float distanceSquared​(Vector2fc v)
      Specified by:
      distanceSquared in interface Vector2fc
    • distance

      public float distance​(float x, float y)
      Specified by:
      distance in interface Vector2fc
    • distanceSquared

      public float distanceSquared​(float x, float y)
      Specified by:
      distanceSquared in interface Vector2fc
    • normalize

      public Vector2f normalize()
    • normalize

      public Vector2f normalize​(Vector2f dest)
      Specified by:
      normalize in interface Vector2fc
    • add

      public Vector2f add​(Vector2fc v)
    • add

      public Vector2f add​(Vector2fc v, Vector2f dest)
      Specified by:
      add in interface Vector2fc
    • add

      public Vector2f add​(float x, float y)
    • add

      public Vector2f add​(float x, float y, Vector2f dest)
      Specified by:
      add in interface Vector2fc
    • zero

      public Vector2f zero()
    • writeExternal

      public void writeExternal​(java.io.ObjectOutput out) throws java.io.IOException
      Specified by:
      writeExternal in interface java.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 interface java.io.Externalizable
      Throws:
      java.io.IOException
      java.lang.ClassNotFoundException
    • negate

      public Vector2f negate()
    • negate

      public Vector2f negate​(Vector2f dest)
      Specified by:
      negate in interface Vector2fc
    • mul

      public Vector2f mul​(float scalar)
    • mul

      public Vector2f mul​(float scalar, Vector2f dest)
      Specified by:
      mul in interface Vector2fc
    • mul

      public Vector2f mul​(float x, float y)
    • mul

      public Vector2f mul​(float x, float y, Vector2f dest)
      Specified by:
      mul in interface Vector2fc
    • mul

      public Vector2f mul​(Vector2fc v)
    • mul

      public Vector2f mul​(Vector2fc v, Vector2f dest)
      Specified by:
      mul in interface Vector2fc
    • lerp

      public Vector2f lerp​(Vector2fc other, float t)
    • lerp

      public Vector2f lerp​(Vector2fc other, float t, Vector2f dest)
      Specified by:
      lerp in interface Vector2fc
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • toString

      public java.lang.String toString​(java.text.NumberFormat formatter)
    • fma

      public Vector2f fma​(Vector2fc a, Vector2fc b)
    • fma

      public Vector2f fma​(float a, Vector2fc b)
    • fma

      public Vector2f fma​(Vector2fc a, Vector2fc b, Vector2f dest)
      Specified by:
      fma in interface Vector2fc
    • fma

      public Vector2f fma​(float a, Vector2fc b, Vector2f dest)
      Specified by:
      fma in interface Vector2fc
    • toImmutable

      public Vector2fc toImmutable()