Load normal data from model
This commit is contained in:
parent
f8835854a3
commit
88c43149dc
2 changed files with 6 additions and 2 deletions
|
@ -5,7 +5,8 @@
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
struct Vertex {
|
struct Vertex {
|
||||||
std::array<float, 4> position;
|
std::array<float, 3> position;
|
||||||
|
std::array<float, 3> normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Part {
|
struct Part {
|
||||||
|
|
|
@ -370,7 +370,10 @@ Model parseMDL(const std::string_view path) {
|
||||||
|
|
||||||
switch(usage) {
|
switch(usage) {
|
||||||
case VertexUsage::Position:
|
case VertexUsage::Position:
|
||||||
vertices[k].position = floatData;
|
memcpy(vertices[k].position.data(), floatData.data(), sizeof(float) * 3);
|
||||||
|
break;
|
||||||
|
case VertexUsage::Normal:
|
||||||
|
memcpy(vertices[k].normal.data(), floatData.data(), sizeof(float) * 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue