RavEngine
Loading...
Searching...
No Matches
MeshAllocation.hpp
1#pragma once
2#include "DataStructures.hpp"
3#include "Mesh.hpp"
4
5namespace RavEngine {
6 using allocation_freelist_t = LinkedList<Range>;
7 using allocation_allocatedlist_t = allocation_freelist_t;
8
9 struct MeshRange {
10 private:
11 allocation_allocatedlist_t::iterator vertRange, indexRange;
12 struct typedRange {
14 };
15
16 public:
17 MeshRange(const decltype(vertRange)& vr, const decltype(indexRange)& ir) : vertRange(vr), indexRange(ir) {}
18 MeshRange(){}
19
20 auto getVertRange() const {
21 return vertRange;
22 }
23 auto getIndexRange() const {
24 return indexRange;
25 }
26
27 uint32_t getIndexRangeStart() const {
28 return indexRange->start;
29 }
30
31 uint32_t getIndexRangeByteStart() const {
32 return indexRange->start * sizeof(uint32_t);
33 }
34
35 uint32_t getVertexRangeStart() const {
36 return vertRange->start;
37 }
38
39 uint32_t getPositionByteStart() const {
40 return vertRange->start * sizeof(VertexPosition_t);
41 }
42 uint32_t getNormalByteStart() const {
43 return vertRange->start * sizeof(VertexNormal_t);
44 }
45 uint32_t getTangentByteStart() const {
46 return vertRange->start * sizeof(VertexTangent_t);
47 }
48 uint32_t getBitangentByteStart() const {
49 return vertRange->start * sizeof(VertexBitangent_t);
50 }
51 uint32_t getUVByteStart() const {
52 return vertRange->start * sizeof(VertexUV_t);
53 }
54 };
55}
Definition concurrentqueue.h:747
Definition Animation.hpp:6
Definition MeshAllocation.hpp:9