mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:36:44 +02:00
Fixing review comments
This commit is contained in:
parent
c92a6d58ab
commit
429d82e650
3 changed files with 8 additions and 18 deletions
|
@ -12,8 +12,6 @@
|
||||||
#ifndef hifi_FBXReader_h
|
#ifndef hifi_FBXReader_h
|
||||||
#define hifi_FBXReader_h
|
#define hifi_FBXReader_h
|
||||||
|
|
||||||
#define USE_MODEL_MESH 1
|
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVarLengthArray>
|
#include <QVarLengthArray>
|
||||||
|
@ -188,9 +186,8 @@ public:
|
||||||
QVector<FBXBlendshape> blendshapes;
|
QVector<FBXBlendshape> blendshapes;
|
||||||
|
|
||||||
unsigned int meshIndex; // the order the meshes appeared in the object file
|
unsigned int meshIndex; // the order the meshes appeared in the object file
|
||||||
# if USE_MODEL_MESH
|
|
||||||
model::MeshPointer _mesh;
|
model::MeshPointer _mesh;
|
||||||
# endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExtractedMesh {
|
class ExtractedMesh {
|
||||||
|
|
|
@ -495,8 +495,8 @@ void FBXReader::buildModelMesh(ExtractedMesh& extracted, const QString& url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ib = std::make_shared<gpu::Buffer>();
|
auto indexBuffer = std::make_shared<gpu::Buffer>();
|
||||||
ib->resize(totalIndices * sizeof(int));
|
indexBuffer->resize(totalIndices * sizeof(int));
|
||||||
|
|
||||||
int indexNum = 0;
|
int indexNum = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
@ -509,7 +509,7 @@ void FBXReader::buildModelMesh(ExtractedMesh& extracted, const QString& url) {
|
||||||
model::Mesh::Part modelPart(indexNum, 0, 0, model::Mesh::TRIANGLES);
|
model::Mesh::Part modelPart(indexNum, 0, 0, model::Mesh::TRIANGLES);
|
||||||
|
|
||||||
if (part.quadTrianglesIndices.size()) {
|
if (part.quadTrianglesIndices.size()) {
|
||||||
ib->setSubData( offset,
|
indexBuffer->setSubData(offset,
|
||||||
part.quadTrianglesIndices.size() * sizeof(int),
|
part.quadTrianglesIndices.size() * sizeof(int),
|
||||||
(gpu::Byte*) part.quadTrianglesIndices.constData());
|
(gpu::Byte*) part.quadTrianglesIndices.constData());
|
||||||
offset += part.quadTrianglesIndices.size() * sizeof(int);
|
offset += part.quadTrianglesIndices.size() * sizeof(int);
|
||||||
|
@ -518,7 +518,7 @@ void FBXReader::buildModelMesh(ExtractedMesh& extracted, const QString& url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part.triangleIndices.size()) {
|
if (part.triangleIndices.size()) {
|
||||||
ib->setSubData( offset,
|
indexBuffer->setSubData(offset,
|
||||||
part.triangleIndices.size() * sizeof(int),
|
part.triangleIndices.size() * sizeof(int),
|
||||||
(gpu::Byte*) part.triangleIndices.constData());
|
(gpu::Byte*) part.triangleIndices.constData());
|
||||||
offset += part.triangleIndices.size() * sizeof(int);
|
offset += part.triangleIndices.size() * sizeof(int);
|
||||||
|
@ -529,8 +529,8 @@ void FBXReader::buildModelMesh(ExtractedMesh& extracted, const QString& url) {
|
||||||
parts.push_back(modelPart);
|
parts.push_back(modelPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::BufferView ibv(ib, gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::XYZ));
|
gpu::BufferView indexBufferView(indexBuffer, gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::XYZ));
|
||||||
mesh->setIndexBuffer(ibv);
|
mesh->setIndexBuffer(indexBufferView);
|
||||||
|
|
||||||
if (parts.size()) {
|
if (parts.size()) {
|
||||||
auto pb = std::make_shared<gpu::Buffer>();
|
auto pb = std::make_shared<gpu::Buffer>();
|
||||||
|
|
|
@ -192,13 +192,6 @@ public:
|
||||||
class NetworkMesh {
|
class NetworkMesh {
|
||||||
public:
|
public:
|
||||||
model::MeshPointer _mesh;
|
model::MeshPointer _mesh;
|
||||||
|
};
|
||||||
/* gpu::BufferPointer _indexBuffer;
|
|
||||||
gpu::BufferPointer _vertexBuffer;
|
|
||||||
|
|
||||||
gpu::BufferStreamPointer _vertexStream;
|
|
||||||
|
|
||||||
gpu::Stream::FormatPointer _vertexFormat;
|
|
||||||
*/};
|
|
||||||
|
|
||||||
#endif // hifi_GeometryCache_h
|
#endif // hifi_GeometryCache_h
|
||||||
|
|
Loading…
Reference in a new issue