Skip to content

ObjFileParser / Mesh

The Obj File Parser's Mesh class does not bring any new functionality to the table. It's just a container for the three objects that can make up a mesh by PHP OpenGLs definition.

  • Vertices (FloatBuffer) storing the vertex data, like position, normal, texture coordinates, etc.
  • indices (UIntBuffer) storing the indices of the vertices that make up the triangles. optional
  • Material the material of the mesh. optional
namespace GL\Geometry\ObjFileParser
    class Mesh {}



The material of the mesh (can be null)

 * @var \GL\Geometry\ObjFileParser\Material|null
public readonly ?Material $material;


A float buffer containing vertex data of the mesh. The layout of the data is not fixed but rather requested by the user. Read more about the layout here.

 * @var \GL\Buffer\FloatBuffer
public readonly FloatBuffer $vertices;


A unsigned int buffer containing indices of the mesh. (optional)

 * @var \GL\Buffer\UIntBuffer|null
public readonly ?UIntBuffer $indices;