Class Vector
- java.lang.Object
-
- net.lax1dude.eaglercraft.v1_8.vector.Vector
-
- All Implemented Interfaces:
java.io.Serializable
,ReadableVector
- Direct Known Subclasses:
Quaternion
,Vector2f
,Vector3f
,Vector4f
public abstract class Vector extends java.lang.Object implements java.io.Serializable, ReadableVector
Base class for vectors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Vector()
Constructor for Vector.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description float
length()
abstract float
lengthSquared()
abstract Vector
load(FloatBuffer buf)
Load this vector from a FloatBufferabstract Vector
negate()
Negate a vectorVector
normalise()
Normalise this vectorabstract Vector
scale(float scale)
Scale this vectorabstract Vector
store(FloatBuffer buf)
Store this vector in a FloatBuffer
-
-
-
Method Detail
-
length
public final float length()
- Specified by:
length
in interfaceReadableVector
- Returns:
- the length of the vector
-
lengthSquared
public abstract float lengthSquared()
- Specified by:
lengthSquared
in interfaceReadableVector
- Returns:
- the length squared of the vector
-
load
public abstract Vector load(FloatBuffer buf)
Load this vector from a FloatBuffer- Parameters:
buf
- The buffer to load it from, at the current position- Returns:
- this
-
negate
public abstract Vector negate()
Negate a vector- Returns:
- this
-
normalise
public final Vector normalise()
Normalise this vector- Returns:
- this
-
store
public abstract Vector store(FloatBuffer buf)
Store this vector in a FloatBuffer- Specified by:
store
in interfaceReadableVector
- Parameters:
buf
- The buffer to store it in, at the current position- Returns:
- this
-
scale
public abstract Vector scale(float scale)
Scale this vector- Parameters:
scale
- The scale factor- Returns:
- this
-
-