mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 12:51:15 +02:00
position are used correctly for evaluting bounds in the Mesh
This commit is contained in:
parent
15f54ac47d
commit
21f65d8a78
2 changed files with 7 additions and 5 deletions
|
@ -781,7 +781,7 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) {
|
|||
attribChannel = 2;
|
||||
|
||||
totalAttribBufferSize = totalVertsSize - positionsSize - normalsAndTangentsSize;
|
||||
} else {
|
||||
} /*else {
|
||||
auto posBuffer = std::make_shared<gpu::Buffer>();
|
||||
posBuffer->setData(positionsSize, (const gpu::Byte*) vertBuffer->getData() + positionsOffset);
|
||||
vertexBufferStream->addBuffer(posBuffer, 0, positionElement.getSize());
|
||||
|
@ -794,7 +794,7 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) {
|
|||
attribChannel = 1;
|
||||
|
||||
totalAttribBufferSize = totalVertsSize - positionsSize;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Define the vertex format, compute the offset for each attributes as we append them to the vertex format
|
||||
gpu::Offset bufOffset = 0;
|
||||
|
|
|
@ -120,7 +120,8 @@ Box Mesh::evalPartBound(int partNum) const {
|
|||
for (;index != endIndex; index++) {
|
||||
// skip primitive restart indices
|
||||
if ((*index) != PRIMITIVE_RESTART_INDEX) {
|
||||
box += vertices[(*index)];
|
||||
// box += vertices[(*index)];
|
||||
box += _vertexBuffer.get<Vec3>(part._baseVertex + (*index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,11 +138,12 @@ Box Mesh::evalPartsBound(int partStart, int partEnd) const {
|
|||
Box partBound;
|
||||
auto index = _indexBuffer.cbegin<uint>() + (*part)._startIndex;
|
||||
auto endIndex = index + (*part)._numIndices;
|
||||
auto vertices = &_vertexBuffer.get<Vec3>((*part)._baseVertex);
|
||||
//auto vertices = &_vertexBuffer.get<Vec3>((*part)._baseVertex);
|
||||
for (;index != endIndex; index++) {
|
||||
// skip primitive restart indices
|
||||
if ((*index) != (uint) PRIMITIVE_RESTART_INDEX) {
|
||||
partBound += vertices[(*index)];
|
||||
//partBound += vertices[(*index)];
|
||||
partBound += _vertexBuffer.get<Vec3>((*part)._baseVertex + (*index));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue