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:
org.lwjgl.system.Pointer
public class ParShapesMesh extends org.lwjgl.system.Struct
Thepar_shapes.h
mesh structure.LWJGL note: in the default build,
PAR_SHAPES_T
isuint32_t
.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 Description static class
ParShapesMesh.Buffer
An array ofParShapesMesh
structs.
-
Constructor Summary
Constructors Constructor 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 Description static ParShapesMesh
create(long address)
Returns a newParShapesMesh
instance for the specified memory address.static ParShapesMesh.Buffer
create(long address, int capacity)
Create aParShapesMesh.Buffer
instance at the specified memory.static ParShapesMesh
createSafe(long address)
static ParShapesMesh.Buffer
createSafe(long address, int capacity)
static java.nio.FloatBuffer
nnormals(long struct, int capacity)
Unsafe version ofnormals
.static int
nnpoints(long struct)
Unsafe version ofnpoints()
.static int
nntriangles(long struct)
Unsafe version ofntriangles()
.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.static java.nio.FloatBuffer
npoints(long struct, int capacity)
Unsafe version ofpoints
.static java.nio.FloatBuffer
ntcoords(long struct, int capacity)
Unsafe version oftcoords
.int
ntriangles()
Returns the value of thentriangles
field.static java.nio.IntBuffer
ntriangles(long struct, int capacity)
Unsafe version oftriangles
.java.nio.FloatBuffer
points(int capacity)
Returns aFloatBuffer
view of the data pointed to by thepoints
field.int
sizeof()
java.nio.FloatBuffer
tcoords(int capacity)
Returns aFloatBuffer
view of the data pointed to by thetcoords
field.java.nio.IntBuffer
triangles(int capacity)
Returns aIntBuffer
view of the data pointed to by thetriangles
field.
-
-
-
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()
- Specified by:
sizeof
in classorg.lwjgl.system.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.IntBuffer triangles(int capacity)
Returns aIntBuffer
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
@Nullable 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
@Nullable 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
-
create
public static ParShapesMesh create(long address)
Returns a newParShapesMesh
instance for the specified memory address.
-
createSafe
@Nullable public static ParShapesMesh createSafe(long address)
-
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
-
createSafe
@Nullable public static ParShapesMesh.Buffer createSafe(long address, int capacity)
-
npoints
public static java.nio.FloatBuffer npoints(long struct, int capacity)
Unsafe version ofpoints
.
-
nnpoints
public static int nnpoints(long struct)
Unsafe version ofnpoints()
.
-
ntriangles
public static java.nio.IntBuffer ntriangles(long struct, int capacity)
Unsafe version oftriangles
.
-
nntriangles
public static int nntriangles(long struct)
Unsafe version ofntriangles()
.
-
nnormals
@Nullable public static java.nio.FloatBuffer nnormals(long struct, int capacity)
Unsafe version ofnormals
.
-
ntcoords
@Nullable public static java.nio.FloatBuffer ntcoords(long struct, int capacity)
Unsafe version oftcoords
.
-
-