Toast Engine
Loading...
Searching...
No Matches
assets::Mesh Class Referencefinal
Inheritance diagram for assets::Mesh:
Collaboration diagram for assets::Mesh:

Public Types

using Index = uint32_t

Public Member Functions

 Mesh (const std::vector< uint8_t > &data)
 Mesh (std::string_view name, std::vector< renderer::Vertex > &&vertices, std::vector< uint32_t > &&indices)
 Mesh (std::string_view name, std::vector< renderer::Vertex > &&vertices, std::vector< uint32_t > &&indices, std::vector< renderer::SkinVertex > &&skin_vertices)
auto type () const -> std::string_view override
auto vertices () const -> const std::vector< renderer::Vertex > &
auto indices () const -> const std::vector< Index > &
auto skinVertices () const -> const std::vector< renderer::SkinVertex > &
auto isSkinned () const noexcept -> bool
auto boundingSphere () const -> const glm::vec4 &
 Local-space bounding sphere: xyz centre, w radius.
auto gpuMesh () const -> const renderer::VulkanMesh &
auto gpuMesh () -> renderer::VulkanMesh &
auto name () const -> const std::string &
auto toBinary () const -> std::vector< uint8_t >
Public Member Functions inherited from assets::Asset
 Asset (const Asset &)=delete
auto operator= (const Asset &) -> Asset &=delete
auto refCount () const noexcept -> uint32_t

Additional Inherited Members

Protected Member Functions inherited from assets::Asset
void addRef () noexcept
void release () noexcept

Constructor & Destructor Documentation

◆ Mesh()

assets::Mesh::Mesh ( std::string_view name,
std::vector< renderer::Vertex > && vertices,
std::vector< uint32_t > && indices,
std::vector< renderer::SkinVertex > && skin_vertices )
Parameters
skin_verticesPer-vertex joint influences; must be empty or exactly as long as vertices

Member Function Documentation

◆ boundingSphere()

auto assets::Mesh::boundingSphere ( ) const -> const glm::vec4 &
nodiscard

Local-space bounding sphere: xyz centre, w radius.

Cached on first use - caster culling asks once per instance per frame, and Bistro's vertex buffers are too large to walk that often

Padded generously for skinned meshes, whose sphere covers the bind pose only: a limb can swing outside it, and a wrongly culled caster is a shadow popping out of existence while a wrongly kept one is a draw

◆ skinVertices()

auto assets::Mesh::skinVertices ( ) const -> const std::vector< renderer::SkinVertex > &
inlinenodiscard
Returns
per-vertex joint influences, parallel to vertices(); empty for a static mesh

◆ type()

auto assets::Mesh::type ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Implements assets::Asset.


The documentation for this class was generated from the following files:
  • engine/src/toast/assets/mesh.hpp
  • engine/src/toast/assets/mesh.cpp