Package com.raylib
Class Vector2
java.lang.Object
com.raylib.Vector2
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MemorySegment
The 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 Vector2
allocateArray
(long elementCount) Allocate an array of Vector2static Vector2
allocateArray
(long elementCount, SegmentAllocator allocator) Allocate an array of Vector2boolean
Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equalgetArrayElement
(int index) float
getX()
Vector x componentfloat
getY()
Vector y componentint
hashCode()
setX
(float value) Vector x componentsetY
(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
Vector x component -
getY
public float getY()Vector y component -
setY
Vector y component
-