Package org.lwjgl.util.par
Class ParShapesMesh
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.par.ParShapesMesh
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class ParShapesMesh extends Struct
Thepar_shapes.h
mesh structure.Member documentation
points
– a flat list of 3-tuples (X Y Z X Y Z...) for the vertex positionsnpoints
– the number of pointstriangles
– flat list of 3-tuples (I J K I J K...)ntriangles
– the number of trianglesnormals
– an optional list of 3-tuples (X Y Z X Y Z...) for the vertex normalstcoords
– an optional list of 2-tuples (U V U V U V...) for the vertex texture coordinates
Layout
struct par_shapes_mesh { float * points; int npoints; PAR_SHAPES_T * triangles; int ntriangles; float * normals; float * tcoords; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
ParShapesMesh.Buffer
An array ofParShapesMesh
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description ParShapesMesh(java.nio.ByteBuffer container)
Creates aParShapesMesh
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static ParShapesMesh
calloc()
Returns a newParShapesMesh
instance allocated withmemCalloc
.static ParShapesMesh.Buffer
calloc(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withmemCalloc
.static ParShapesMesh
callocStack()
Returns a newParShapesMesh
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ParShapesMesh.Buffer
callocStack(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ParShapesMesh.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newParShapesMesh.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ParShapesMesh
callocStack(MemoryStack stack)
Returns a newParShapesMesh
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ParShapesMesh
create()
Returns a newParShapesMesh
instance allocated withBufferUtils
.static ParShapesMesh.Buffer
create(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withBufferUtils
.static ParShapesMesh
create(long address)
Returns a newParShapesMesh
instance for the specified memory address ornull
if the address isNULL
.static ParShapesMesh.Buffer
create(long address, int capacity)
Create aParShapesMesh.Buffer
instance at the specified memory.static ParShapesMesh
malloc()
Returns a newParShapesMesh
instance allocated withmemAlloc
.static ParShapesMesh.Buffer
malloc(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withmemAlloc
.static ParShapesMesh
mallocStack()
Returns a newParShapesMesh
instance allocated on the thread-localMemoryStack
.static ParShapesMesh.Buffer
mallocStack(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated on the thread-localMemoryStack
.static ParShapesMesh.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newParShapesMesh.Buffer
instance allocated on the specifiedMemoryStack
.static ParShapesMesh
mallocStack(MemoryStack stack)
Returns a newParShapesMesh
instance allocated on the specifiedMemoryStack
.java.nio.FloatBuffer
normals(int capacity)
Returns aFloatBuffer
view of the data pointed to by thenormals
field.int
npoints()
Returns the value of thenpoints
field.int
ntriangles()
Returns the value of thentriangles
field.java.nio.FloatBuffer
points(int capacity)
Returns aFloatBuffer
view of the data pointed to by thepoints
field.int
sizeof()
Returns thesizeof(struct)
.java.nio.FloatBuffer
tcoords(int capacity)
Returns aFloatBuffer
view of the data pointed to by thetcoords
field.java.nio.ShortBuffer
triangles(int capacity)
Returns aShortBuffer
view of the data pointed to by thetriangles
field.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
ParShapesMesh
public ParShapesMesh(java.nio.ByteBuffer container)
Creates aParShapesMesh
instance at the current position of the specifiedByteBuffer
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.
-
-
Method Detail
-
sizeof
public int sizeof()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
points
public java.nio.FloatBuffer points(int capacity)
Returns aFloatBuffer
view of the data pointed to by thepoints
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
npoints
public int npoints()
Returns the value of thenpoints
field.
-
triangles
public java.nio.ShortBuffer triangles(int capacity)
Returns aShortBuffer
view of the data pointed to by thetriangles
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
ntriangles
public int ntriangles()
Returns the value of thentriangles
field.
-
normals
public java.nio.FloatBuffer normals(int capacity)
Returns aFloatBuffer
view of the data pointed to by thenormals
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
tcoords
public java.nio.FloatBuffer tcoords(int capacity)
Returns aFloatBuffer
view of the data pointed to by thetcoords
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
malloc
public static ParShapesMesh malloc()
Returns a newParShapesMesh
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ParShapesMesh calloc()
Returns a newParShapesMesh
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ParShapesMesh create()
Returns a newParShapesMesh
instance allocated withBufferUtils
.
-
create
public static ParShapesMesh create(long address)
Returns a newParShapesMesh
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static ParShapesMesh.Buffer malloc(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static ParShapesMesh.Buffer calloc(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static ParShapesMesh.Buffer create(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static ParShapesMesh.Buffer create(long address, int capacity)
Create aParShapesMesh.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static ParShapesMesh mallocStack()
Returns a newParShapesMesh
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ParShapesMesh callocStack()
Returns a newParShapesMesh
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ParShapesMesh mallocStack(MemoryStack stack)
Returns a newParShapesMesh
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ParShapesMesh callocStack(MemoryStack stack)
Returns a newParShapesMesh
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static ParShapesMesh.Buffer mallocStack(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static ParShapesMesh.Buffer callocStack(int capacity)
Returns a newParShapesMesh.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static ParShapesMesh.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newParShapesMesh.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static ParShapesMesh.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newParShapesMesh.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-