Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
IndexedTriMesh.h
Go to the documentation of this file.
1#pragma once
2
4#include "Math/TVector3.h"
5
6#include <Common/assertion.h>
7
8#include <cstddef>
9#include <array>
10
11namespace ph
12{
13
15{
16public:
17 explicit IndexedTriMesh(std::size_t numFaces);
18 virtual ~IndexedTriMesh() = default;
19
20 virtual TriFace getFace(std::size_t index) const = 0;
21
22 virtual std::array<math::Vector3R, 3> getVertices(std::size_t index) const;
23
24 std::size_t numFaces() const;
25
26 // TODO: interface for aquiring new UV from a different channel
27 // TODO: do we need to know how many UV channels this mesh is supporting?
28
29protected:
30 std::size_t m_numFaces;
31};
32
33// In-header Implementations:
34
35inline IndexedTriMesh::IndexedTriMesh(const std::size_t numFaces) :
36 m_numFaces(numFaces)
37{
38 PH_ASSERT_GT(numFaces, 0);
39}
40
41inline std::array<math::Vector3R, 3> IndexedTriMesh::getVertices(const std::size_t index) const
42{
43 return getFace(index).getVertices();
44}
45
46inline std::size_t IndexedTriMesh::numFaces() const
47{
48 return m_numFaces;
49}
50
51}// end namespace ph
Definition IndexedTriMesh.h:15
std::size_t numFaces() const
Definition IndexedTriMesh.h:46
virtual ~IndexedTriMesh()=default
std::size_t m_numFaces
Definition IndexedTriMesh.h:30
virtual std::array< math::Vector3R, 3 > getVertices(std::size_t index) const
Definition IndexedTriMesh.h:41
IndexedTriMesh(std::size_t numFaces)
Definition IndexedTriMesh.h:35
virtual TriFace getFace(std::size_t index) const =0
Definition TriFace.h:15
const std::array< math::Vector3R, 3 > & getVertices() const
Definition TriFace.h:62
The root for all renderer implementations.
Definition EEngineProject.h:6