From 38eff07d0d6b588dcbe529ba0e6d95ec0725c61d Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 9 Oct 2017 22:36:39 +0200 Subject: [PATCH] Fix issue and small changes in TriangleVertexArray --- src/collision/TriangleVertexArray.cpp | 2 +- src/collision/TriangleVertexArray.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/collision/TriangleVertexArray.cpp b/src/collision/TriangleVertexArray.cpp index 56f3b422..7cfb2076 100644 --- a/src/collision/TriangleVertexArray.cpp +++ b/src/collision/TriangleVertexArray.cpp @@ -194,7 +194,7 @@ void TriangleVertexArray::getTriangleVerticesIndices(uint triangleIndex, uint* o assert(triangleIndex >= 0 && triangleIndex < mNbTriangles); - const uchar* triangleIndicesPointer = mIndicesStart + triangleIndex * 3 * mIndicesStride; + const uchar* triangleIndicesPointer = mIndicesStart + triangleIndex * mIndicesStride; const void* startTriangleIndices = static_cast(triangleIndicesPointer); // For each vertex of the triangle diff --git a/src/collision/TriangleVertexArray.h b/src/collision/TriangleVertexArray.h index 3db79c7e..3a48c2e3 100644 --- a/src/collision/TriangleVertexArray.h +++ b/src/collision/TriangleVertexArray.h @@ -122,6 +122,12 @@ class TriangleVertexArray { /// Destructor ~TriangleVertexArray(); + /// Deleted assignment operator + TriangleVertexArray& operator=(const TriangleVertexArray& triangleVertexArray) = delete; + + /// Deleted copy-constructor + TriangleVertexArray(const TriangleVertexArray& triangleVertexArray) = delete; + /// Return the vertex data type VertexDataType getVertexDataType() const; @@ -141,7 +147,7 @@ class TriangleVertexArray { uint getVerticesStride() const; /// Return the vertex normals stride (number of bytes) - uint getVerticesNormlasStride() const; + uint getVerticesNormalsStride() const; /// Return the indices stride (number of bytes) uint getIndicesStride() const; @@ -196,7 +202,7 @@ inline uint TriangleVertexArray::getVerticesStride() const { } // Return the vertex normals stride (number of bytes) -inline uint TriangleVertexArray::getVerticesNormlasStride() const { +inline uint TriangleVertexArray::getVerticesNormalsStride() const { return mVerticesNormalsStride; }