Mesh.ixx File
Mesh abstraction: immutable vertex/index data and configuration. More...
Included Headers
#include <memory>
#include <stdexcept>
#include <vector>
#include <cmath>
#include <limits>
#include <helios.math.types>
#include <helios.util.log.Logger>
#include <helios.util.log.LogManager>
#include <helios.rendering.asset.shape.Shape>
#include <helios.rendering.Vertex>
#include <helios.rendering.mesh.MeshConfig>
Namespaces Index
| namespace | helios |
| namespace | rendering |
|
Graphics rendering infrastructure. More... | |
| namespace | mesh |
Classes Index
| class | Mesh |
|
Representative of a renderable 3D mesh. More... | |
Macro Definitions Index
| #define | HELIOS_LOG_SCOPE "helios::rendering::mesh::Mesh" |
Description
Mesh abstraction: immutable vertex/index data and configuration.
File Listing
The file content with the documentation metadata removed is:
25#define HELIOS_LOG_SCOPE "helios::rendering::mesh::Mesh"
26export namespace helios::rendering::mesh {
51 mutable bool needsUpdate_ = true;
65 mutable helios::math::aabbf aabb_{};
80 std::shared_ptr<const helios::rendering::mesh::MeshConfig> meshConfig_;
100 inline static const helios::util::log::Logger& logger_ = helios::util::log::LogManager::loggerForScope(
101 HELIOS_LOG_SCOPE
115 * @throws std::invalid_argument if either "vertices", "indices" or meshConfig is a null shared_ptr
118 std::shared_ptr<const std::vector<Vertex>> vertices,
119 std::shared_ptr<const std::vector<unsigned int>> indices,
120 std::shared_ptr<const helios::rendering::mesh::MeshConfig> meshConfig
123 meshConfig_(std::move(meshConfig)) {
125 if (!vertices_ || !indices_ || !meshConfig_) {
127 logger_.error(msg);
142 const helios::rendering::asset::shape::Shape& shape,
143 std::shared_ptr<const helios::rendering::mesh::MeshConfig> meshConfig
147 meshConfig_(std::move(meshConfig)) {
149 if (!vertices_ || !indices_ || !meshConfig_) {
151 logger_.error(msg);
161 [[nodiscard]] unsigned int indexCount() const noexcept {
162 return indices_->size();
172 return *vertices_;
182 return *indices_;
191 [[nodiscard]] const helios::rendering::mesh::MeshConfig& meshConfig() const noexcept {
192 return *meshConfig_;
207 [[nodiscard]] const helios::math::aabbf& aabb() const noexcept {
208 if (needsUpdate_) {
209 if (!vertices_->empty()) {
217 for (const auto& v: *vertices_) {
229 aabb_ = helios::math::aabbf(minX, minY, minZ, maxX, maxY, maxZ);
231 aabb_ = helios::math::aabbf(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
234 needsUpdate_ = false;
237 return aabb_;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.