Skip to main content

Vector2Buffer

class Vector2Buffer

A Vector2Buffer is a NativeFloatBuffer adapter and Vector2 array that instead of being allocated in Java's heap memory is allocated in native memory, so if you need to use more memory than the available heap memory, use Vector2Buffer and you will be able to use 100% of device ram memory.


public class Vector2Buffer

— Constructors (3) —

ConstructorDescription
Vector2Buffer()Creates a new Vector2Buffer.
Vector2Buffer(int vectorCount)Creates a new Vector2Buffer with its size defined to be "vectorCount" argument.
Vector2Buffer(NativeFloatBuffer nativeFloatBuffer)Creates a new Vector2Buffer with its size defined to be "nativeFloatBuffer" argument.

— Methods (13) —

NameDescription
Vector2 get(int idx)Returns the current value of the two axes of the position vector defined to be "idx" argument.
float getX(int idx)Returns the current value of the X axis of the position vector defined to be "idx" argument.
float getY(int idx)Returns the current value of the Y axis of the position vector defined to be "idx" argument.
void put(Vector2 value)Places a value defined to be "value" argument sequentially in the Vector2Buffer.
void put(float x, float y)Places the X axis value defined to be "x" argument,and Y axis to be "y" argument sequentially in the Vector2Buffer.
void set(int idx, Vector2 value)Sets the current value of Vector2Buffer to be "value" argument and its current position to be "idx" argument.
void set(int idx, float x, float y)Sets the current value of X axis to be "x" argument, Y axis to be "y" argument of the Vector2Buffer and its current position to be "idx" argument.
int capacity()Returns the maximum Vector2Buffer capacity value.
Vector2[] array()Returns an array of current Vector2Buffer values.
void position(int idx)Returns the current position of the vector defined to be "idx" argument.
boolean isVboEnabled()Returns true if the vbo of Vector2Buffer is enabled, false if not.
void setVboEnabled(boolean value)Defines if Vector2Buffer's vbo will be enabled or disabled to be "value" argument.
Vector2Buffer copy()Returns a perfect copy of Vector2Buffer.