Class RenderModel

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class RenderModel
    extends Struct
    implements NativeResource

    Member documentation

    • rVertexData – Vertex data for the mesh
    • unVertexCount – Number of vertices in the vertex data
    • IndexData – Indices into the vertex data for each triangle
    • unTriangleCount – Number of triangles in the mesh. Index count is 3 * TriangleCount.
    • diffuseTextureId – Session unique texture identifier. Rendermodels which share the same texture will have the same id. 0 == texture not present.

    Layout

    
     struct RenderModel_t {
         RenderModel_Vertex_t const * rVertexData;
         uint32_t unVertexCount;
         uint16_t const * IndexData;
         uint32_t unTriangleCount;
         TextureID_t diffuseTextureId;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • RVERTEXDATA, UNVERTEXCOUNT, INDEXDATA, UNTRIANGLECOUNT, DIFFUSETEXTUREID

        The struct member offsets.
    • Constructor Detail

      • RenderModel

        public RenderModel​(java.nio.ByteBuffer container)
        Creates a RenderModel 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.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • unVertexCount

        public int unVertexCount()
        Returns the value of the unVertexCount field.
      • IndexData

        public java.nio.ShortBuffer IndexData()
        Returns a ShortBuffer view of the data pointed to by the IndexData field.
      • unTriangleCount

        public int unTriangleCount()
        Returns the value of the unTriangleCount field.
      • diffuseTextureId

        public int diffuseTextureId()
        Returns the value of the diffuseTextureId field.
      • create

        public static RenderModel create​(long address)
        Returns a new RenderModel instance for the specified memory address.
      • createSafe

        @Nullable
        public static RenderModel createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static RenderModel.Buffer create​(long address,
                                                int capacity)
        Create a RenderModel.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static RenderModel.Buffer createSafe​(long address,
                                                    int capacity)
        Like create, but returns null if address is NULL.
      • callocStack

        public static RenderModel callocStack()
        Returns a new RenderModel instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

        public static RenderModel callocStack​(MemoryStack stack)
        Returns a new RenderModel instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static RenderModel.Buffer callocStack​(int capacity)
        Returns a new RenderModel.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static RenderModel.Buffer callocStack​(int capacity,
                                                     MemoryStack stack)
        Returns a new RenderModel.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nunVertexCount

        public static int nunVertexCount​(long struct)
        Unsafe version of unVertexCount().
      • nIndexData

        public static java.nio.ShortBuffer nIndexData​(long struct)
        Unsafe version of IndexData.
      • nunTriangleCount

        public static int nunTriangleCount​(long struct)
        Unsafe version of unTriangleCount().
      • ndiffuseTextureId

        public static int ndiffuseTextureId​(long struct)
        Unsafe version of diffuseTextureId().