Class Vector2
java.lang.Object
com.raylib.Vector2
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MemorySegmentThe native FFI MemorySegment that holds the data this object wraps. -
Constructor Summary
ConstructorsConstructorDescriptionVector2()Construct with auto memory allocator and fields initialized to zero.Vector2(float x, float y) Construct with auto memory allocator and fields initialized as specifiedVector2(MemorySegment memorySegment) Construct by wrapping around an already allocated MemorySegment, perhaps from another objectVector2(SegmentAllocator arena) Construct with your owm memory allocator and fields not initializedVector2(SegmentAllocator arena, float x, float y) Construct with your own memory allocator and fields initialized as specified -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector2allocateArray(long elementCount) Allocate an array of Vector2static Vector2allocateArray(long elementCount, SegmentAllocator allocator) Allocate an array of Vector2booleanEquality is tested on basis of both wrapper objects must refer to same native memory location to be considered equalgetArrayElement(int index) floatgetX()Vector x componentfloatgetY()Vector y componentinthashCode()voidsetX(float value) Vector x componentvoidsetY(float value) Vector y componentfloatx()Vector x componentx(float value) Vector x componentfloaty()Vector y componenty(float value) Vector y component
-
Field Details
-
memorySegment
The native FFI MemorySegment that holds the data this object wraps.
-
-
Constructor Details
-
Vector2
public Vector2()Construct with auto memory allocator and fields initialized to zero. -
Vector2
Construct with your owm memory allocator and fields not initialized -
Vector2
Construct by wrapping around an already allocated MemorySegment, perhaps from another object -
Vector2
public Vector2(float x, float y) Construct with auto memory allocator and fields initialized as specified- Parameters:
x- Vector x componenty- Vector y component
-
Vector2
Construct with your own memory allocator and fields initialized as specified- Parameters:
x- Vector x componenty- Vector y component
-
-
Method Details
-
equals
-
hashCode
-
getArrayElement
-
allocateArray
Allocate an array of Vector2 -
allocateArray
Allocate an array of Vector2 -
getX
public float getX()Vector x component -
setX
public void setX(float value) Vector x component -
x
public float x()Vector x component -
x
Vector x component -
getY
public float getY()Vector y component -
setY
public void setY(float value) Vector y component -
y
public float y()Vector y component -
y
Vector y component
-