Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/esp/assets/PTexMeshData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,12 @@ void PTexMeshData::parsePLY(const std::string& filename,
CORRADE_ASSERT(positionDimensions > 0,
"PTexMeshData::parsePLY: the dimensions of the position is "
"not greater than 0", );
CORRADE_ASSERT(
positionDimensions == 3,
"PTexMeshData::parsePLY: the dimensions of the position must be 3.", );
}

meshData.vbo.resize(numVertices, vec4f(0, 0, 0, 1));
meshData.vbo.resize(numVertices, vec3f(0, 0, 0));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should assert that positionDimensions < 4.


if (normalDimensions) {
meshData.nbo.resize(numVertices, vec4f(0, 0, 0, 1));
Expand Down
2 changes: 1 addition & 1 deletion src/esp/assets/PTexMeshData.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace assets {
class PTexMeshData : public BaseMesh {
public:
struct MeshData {
std::vector<vec4f> vbo;
std::vector<vec3f> vbo;
std::vector<vec4f> nbo;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't nbo also be a vec3?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, neither nbo nor cbo is used right now (only populated). Is that correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, neither nbo nor cbo is used right now (only populated). Is that correct?

Yes, you are right. I checked them as well before this PR.

std::vector<vec4uc> cbo;
std::vector<uint32_t> ibo;
Expand Down
2 changes: 1 addition & 1 deletion src/esp/gfx/PTexMeshShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace gfx {
class PTexMeshShader : public Magnum::GL::AbstractShaderProgram {
public:
//! @brief vertex positions
typedef Magnum::GL::Attribute<0, Magnum::Vector4> Position;
typedef Magnum::GL::Attribute<0, Magnum::Vector3> Position;

/**
* @brief Constructor
Expand Down