Simulant  21.12-349
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
Public Types | Public Member Functions | Friends | List of all members
smlt::SubMesh Class Reference
Inheritance diagram for smlt::SubMesh:
smlt::RefCounted< SubMesh > smlt::Nameable smlt::TwoPhaseConstructed

Public Types

typedef sig::signal< void(SubMeshPtr, MaterialSlot, MaterialID, MaterialID)> MaterialChangedCallback
- Public Types inherited from smlt::RefCounted< SubMesh >
typedef std::shared_ptr< SubMeshptr
typedef std::weak_ptr< SubMeshwptr

Public Member Functions

 SubMesh (Mesh *parent, const std::string &name, MaterialPtr material, std::shared_ptr< IndexData > &index_data, MeshArrangement arrangement=MESH_ARRANGEMENT_TRIANGLES)
 SubMesh (Mesh *parent, const std::string &name, MaterialPtr material, MeshArrangement arrangement=MESH_ARRANGEMENT_TRIANGLES)
SubmeshType type () const
bool add_vertex_range (uint32_t start, uint32_t count)
 Add a vertex range to this submesh. count vertices will be rendered from the start index in the mesh vertex data. More...
void mark_changed ()
const VertexRangevertex_ranges () const
std::size_t vertex_range_count () const
void remove_all_vertex_ranges ()
void set_material (const MaterialPtr &material)
void set_material_at_slot (MaterialSlot var, const MaterialPtr &material)
MaterialPtr material () const
MaterialPtr material_at_slot (MaterialSlot var, bool fallback=false) const
MeshArrangement arrangement () const
bool reverse_winding ()
void generate_texture_coordinates_cube (uint32_t texture=0)
 SubMesh::generate_texture_coordinates_cube. More...
void set_diffuse (const Colour &colour)
void set_contributes_to_edge_list (bool v=true)
bool contributes_to_edge_list () const
void each_triangle (std::function< void(uint32_t, uint32_t, uint32_t)> cb)
const AABBaabb () const
MaterialChangedCallbacksignal_material_changed ()
 S_DEFINE_PROPERTY (mesh, &SubMesh::parent_)
 S_DEFINE_PROPERTY (index_data, &SubMesh::index_data_)
- Public Member Functions inherited from smlt::TwoPhaseConstructed
virtual bool init ()
virtual void clean_up ()
- Public Member Functions inherited from smlt::Nameable
void set_name (const std::string &name)
const std::string & name () const
bool has_name () const


class Mesh

Additional Inherited Members

- Static Public Member Functions inherited from smlt::RefCounted< SubMesh >
static RefCounted< SubMesh >::ptr create (Args &&... args)
static RefCounted< SubMesh >::ptr create ()
- Protected Member Functions inherited from smlt::RefCounted< SubMesh >
 RefCounted (Args &&...)

Member Function Documentation

◆ aabb()

const AABB & smlt::SubMesh::aabb ( ) const

Return the axis-aligned bounding box for the faces making up this submesh

◆ add_vertex_range()

bool smlt::SubMesh::add_vertex_range ( uint32_t  start,
uint32_t  count 

Add a vertex range to this submesh. count vertices will be rendered from the start index in the mesh vertex data.


◆ generate_texture_coordinates_cube()

void smlt::SubMesh::generate_texture_coordinates_cube ( uint32_t  texture = 0)


texture- which texture unit to generate coordinates for

Generates cube coordinates.

WARNING: Will not duplicate vertices. If you share vertices across polygons this will currently not give correct results. In future a "duplicate_vertices" argument might be added.

The documentation for this class was generated from the following files: