Class Mesh

java.lang.Object
com.raylib.Mesh

public class Mesh extends Object
Mesh, vertex data and vao/vbo
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Mesh

      public Mesh()
      Construct with auto memory allocator and fields initialized to zero.
    • Mesh

      public Mesh(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Mesh

      public Mesh(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Mesh

      public Mesh(int vertexCount, int triangleCount, FloatBuffer vertices, FloatBuffer texcoords, FloatBuffer texcoords2, FloatBuffer normals, FloatBuffer tangents, ByteBuffer colors, MemorySegment indices, FloatBuffer animVertices, FloatBuffer animNormals, ByteBuffer boneIds, FloatBuffer boneWeights, Matrix boneMatrices, int boneCount, int vaoId, MemorySegment vboId)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      vertexCount - Number of vertices stored in arrays
      triangleCount - Number of triangles stored (indexed or not)
      vertices - Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
      texcoords - Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
      texcoords2 - Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
      normals - Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
      tangents - Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
      colors - Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
      indices - Vertex indices (in case vertex data comes indexed)
      animVertices - Animated vertex positions (after bones transformations)
      animNormals - Animated normals (after bones transformations)
      boneIds - Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
      boneWeights - Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
      boneMatrices - Bones animated transformation matrices
      boneCount - Number of bones
      vaoId - OpenGL Vertex Array Object id
      vboId - OpenGL Vertex Buffer Objects id (default vertex data)
    • Mesh

      public Mesh(SegmentAllocator arena, int vertexCount, int triangleCount, FloatBuffer vertices, FloatBuffer texcoords, FloatBuffer texcoords2, FloatBuffer normals, FloatBuffer tangents, ByteBuffer colors, MemorySegment indices, FloatBuffer animVertices, FloatBuffer animNormals, ByteBuffer boneIds, FloatBuffer boneWeights, Matrix boneMatrices, int boneCount, int vaoId, MemorySegment vboId)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      vertexCount - Number of vertices stored in arrays
      triangleCount - Number of triangles stored (indexed or not)
      vertices - Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
      texcoords - Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
      texcoords2 - Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
      normals - Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
      tangents - Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
      colors - Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
      indices - Vertex indices (in case vertex data comes indexed)
      animVertices - Animated vertex positions (after bones transformations)
      animNormals - Animated normals (after bones transformations)
      boneIds - Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
      boneWeights - Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
      boneMatrices - Bones animated transformation matrices
      boneCount - Number of bones
      vaoId - OpenGL Vertex Array Object id
      vboId - OpenGL Vertex Buffer Objects id (default vertex data)
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Mesh getArrayElement(int index)
    • allocateArray

      public static Mesh allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Mesh
    • allocateArray

      public static Mesh allocateArray(long elementCount)
      Allocate an array of Mesh
    • getVertexCount

      public int getVertexCount()
      Number of vertices stored in arrays
    • setVertexCount

      public void setVertexCount(int value)
      Number of vertices stored in arrays
    • vertexCount

      public int vertexCount()
      Number of vertices stored in arrays
    • vertexCount

      public Mesh vertexCount(int value)
      Number of vertices stored in arrays
    • getTriangleCount

      public int getTriangleCount()
      Number of triangles stored (indexed or not)
    • setTriangleCount

      public void setTriangleCount(int value)
      Number of triangles stored (indexed or not)
    • triangleCount

      public int triangleCount()
      Number of triangles stored (indexed or not)
    • triangleCount

      public Mesh triangleCount(int value)
      Number of triangles stored (indexed or not)
    • getVertices

      public FloatBuffer getVertices()
      Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    • setVertices

      public void setVertices(FloatBuffer value)
      Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    • vertices

      public FloatBuffer vertices()
      Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    • vertices

      public Mesh vertices(FloatBuffer value)
      Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    • getTexcoords

      public FloatBuffer getTexcoords()
      Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    • setTexcoords

      public void setTexcoords(FloatBuffer value)
      Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    • texcoords

      public FloatBuffer texcoords()
      Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    • texcoords

      public Mesh texcoords(FloatBuffer value)
      Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    • getTexcoords2

      public FloatBuffer getTexcoords2()
      Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
    • setTexcoords2

      public void setTexcoords2(FloatBuffer value)
      Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
    • texcoords2

      public FloatBuffer texcoords2()
      Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
    • texcoords2

      public Mesh texcoords2(FloatBuffer value)
      Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
    • getNormals

      public FloatBuffer getNormals()
      Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
    • setNormals

      public void setNormals(FloatBuffer value)
      Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
    • normals

      public FloatBuffer normals()
      Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
    • normals

      public Mesh normals(FloatBuffer value)
      Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
    • getTangents

      public FloatBuffer getTangents()
      Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
    • setTangents

      public void setTangents(FloatBuffer value)
      Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
    • tangents

      public FloatBuffer tangents()
      Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
    • tangents

      public Mesh tangents(FloatBuffer value)
      Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
    • getColors

      public ByteBuffer getColors()
      Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    • setColors

      public void setColors(ByteBuffer value)
      Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    • colors

      public ByteBuffer colors()
      Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    • colors

      public Mesh colors(ByteBuffer value)
      Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    • getIndices

      public MemorySegment getIndices()
      Vertex indices (in case vertex data comes indexed)
    • setIndices

      public void setIndices(MemorySegment value)
      Vertex indices (in case vertex data comes indexed)
    • indices

      public MemorySegment indices()
      Vertex indices (in case vertex data comes indexed)
    • indices

      public Mesh indices(MemorySegment value)
      Vertex indices (in case vertex data comes indexed)
    • getAnimVertices

      public FloatBuffer getAnimVertices()
      Animated vertex positions (after bones transformations)
    • setAnimVertices

      public void setAnimVertices(FloatBuffer value)
      Animated vertex positions (after bones transformations)
    • animVertices

      public FloatBuffer animVertices()
      Animated vertex positions (after bones transformations)
    • animVertices

      public Mesh animVertices(FloatBuffer value)
      Animated vertex positions (after bones transformations)
    • getAnimNormals

      public FloatBuffer getAnimNormals()
      Animated normals (after bones transformations)
    • setAnimNormals

      public void setAnimNormals(FloatBuffer value)
      Animated normals (after bones transformations)
    • animNormals

      public FloatBuffer animNormals()
      Animated normals (after bones transformations)
    • animNormals

      public Mesh animNormals(FloatBuffer value)
      Animated normals (after bones transformations)
    • getBoneIds

      public ByteBuffer getBoneIds()
      Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
    • setBoneIds

      public void setBoneIds(ByteBuffer value)
      Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
    • boneIds

      public ByteBuffer boneIds()
      Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
    • boneIds

      public Mesh boneIds(ByteBuffer value)
      Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
    • getBoneWeights

      public FloatBuffer getBoneWeights()
      Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
    • setBoneWeights

      public void setBoneWeights(FloatBuffer value)
      Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
    • boneWeights

      public FloatBuffer boneWeights()
      Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
    • boneWeights

      public Mesh boneWeights(FloatBuffer value)
      Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
    • getBoneMatrices

      public Matrix getBoneMatrices()
      Bones animated transformation matrices
    • setBoneMatrices

      public void setBoneMatrices(Matrix value)
      Bones animated transformation matrices
    • boneMatrices

      public Matrix boneMatrices()
      Bones animated transformation matrices
    • boneMatrices

      public Mesh boneMatrices(Matrix value)
      Bones animated transformation matrices
    • getBoneCount

      public int getBoneCount()
      Number of bones
    • setBoneCount

      public void setBoneCount(int value)
      Number of bones
    • boneCount

      public int boneCount()
      Number of bones
    • boneCount

      public Mesh boneCount(int value)
      Number of bones
    • getVaoId

      public int getVaoId()
      OpenGL Vertex Array Object id
    • setVaoId

      public void setVaoId(int value)
      OpenGL Vertex Array Object id
    • vaoId

      public int vaoId()
      OpenGL Vertex Array Object id
    • vaoId

      public Mesh vaoId(int value)
      OpenGL Vertex Array Object id
    • getVboId

      public MemorySegment getVboId()
      OpenGL Vertex Buffer Objects id (default vertex data)
    • setVboId

      public void setVboId(MemorySegment value)
      OpenGL Vertex Buffer Objects id (default vertex data)
    • vboId

      public MemorySegment vboId()
      OpenGL Vertex Buffer Objects id (default vertex data)
    • vboId

      public Mesh vboId(MemorySegment value)
      OpenGL Vertex Buffer Objects id (default vertex data)