public class Vec2d
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
struct driftfx::math::Vec2d {
double x;
double y;
}| Modifier and Type | Class and Description |
|---|---|
static class |
Vec2d.Buffer
An array of
Vec2d structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
X
The struct member offsets.
|
static int |
Y
The struct member offsets.
|
| Constructor and Description |
|---|
Vec2d(java.nio.ByteBuffer container)
Creates a
Vec2d instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static Vec2d |
calloc()
Returns a new
Vec2d instance allocated with memCalloc. |
static Vec2d.Buffer |
calloc(int capacity)
Returns a new
Vec2d.Buffer instance allocated with memCalloc. |
static Vec2d |
callocStack()
Returns a new
Vec2d instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static Vec2d.Buffer |
callocStack(int capacity)
Returns a new
Vec2d.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static Vec2d.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
Vec2d.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static Vec2d |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
Vec2d instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static Vec2d |
create()
Returns a new
Vec2d instance allocated with BufferUtils. |
static Vec2d.Buffer |
create(int capacity)
Returns a new
Vec2d.Buffer instance allocated with BufferUtils. |
static Vec2d |
create(long address)
Returns a new
Vec2d instance for the specified memory address. |
static Vec2d.Buffer |
create(long address,
int capacity)
Create a
Vec2d.Buffer instance at the specified memory. |
static Vec2d |
createSafe(long address)
|
static Vec2d.Buffer |
createSafe(long address,
int capacity)
|
static Vec2d |
malloc()
Returns a new
Vec2d instance allocated with memAlloc. |
static Vec2d.Buffer |
malloc(int capacity)
Returns a new
Vec2d.Buffer instance allocated with memAlloc. |
static Vec2d |
mallocStack()
Returns a new
Vec2d instance allocated on the thread-local MemoryStack. |
static Vec2d.Buffer |
mallocStack(int capacity)
Returns a new
Vec2d.Buffer instance allocated on the thread-local MemoryStack. |
static Vec2d.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
Vec2d.Buffer instance allocated on the specified MemoryStack. |
static Vec2d |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
Vec2d instance allocated on the specified MemoryStack. |
static double |
nx(long struct)
Unsafe version of
x(). |
static void |
nx(long struct,
double value)
Unsafe version of
x. |
static double |
ny(long struct)
Unsafe version of
y(). |
static void |
ny(long struct,
double value)
Unsafe version of
y. |
Vec2d |
set(double x,
double y)
Initializes this struct with the specified values.
|
Vec2d |
set(Vec2d src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
double |
x()
Returns the value of the
x field. |
Vec2d |
x(double value)
Sets the specified value to the
x field. |
double |
y()
Returns the value of the
y field. |
Vec2d |
y(double value)
Sets the specified value to the
y field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int X
public static final int Y
public Vec2d(java.nio.ByteBuffer container)
Vec2d instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be
visible to the struct instance and vice versa.
The created instance holds a strong reference to the container object.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic double x()
x field.public double y()
y field.public Vec2d x(double value)
x field.public Vec2d y(double value)
y field.public Vec2d set(double x, double y)
public Vec2d set(Vec2d src)
src - the source structpublic static Vec2d malloc()
Vec2d instance allocated with memAlloc. The instance must be explicitly freed.public static Vec2d calloc()
Vec2d instance allocated with memCalloc. The instance must be explicitly freed.public static Vec2d create()
Vec2d instance allocated with BufferUtils.public static Vec2d create(long address)
Vec2d instance for the specified memory address.@Nullable public static Vec2d createSafe(long address)
public static Vec2d.Buffer malloc(int capacity)
Vec2d.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static Vec2d.Buffer calloc(int capacity)
Vec2d.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static Vec2d.Buffer create(int capacity)
Vec2d.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static Vec2d.Buffer create(long address, int capacity)
Vec2d.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static Vec2d.Buffer createSafe(long address, int capacity)
public static Vec2d mallocStack()
Vec2d instance allocated on the thread-local MemoryStack.public static Vec2d callocStack()
Vec2d instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static Vec2d mallocStack(org.lwjgl.system.MemoryStack stack)
Vec2d instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static Vec2d callocStack(org.lwjgl.system.MemoryStack stack)
Vec2d instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static Vec2d.Buffer mallocStack(int capacity)
Vec2d.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static Vec2d.Buffer callocStack(int capacity)
Vec2d.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static Vec2d.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Vec2d.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static Vec2d.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Vec2d.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static double nx(long struct)
x().public static double ny(long struct)
y().public static void nx(long struct,
double value)
x.public static void ny(long struct,
double value)
y.Copyright LWJGL. All Rights Reserved. License terms.