From 9c4e8564b28fc53a63294228d03247d8ac3debed Mon Sep 17 00:00:00 2001 From: Lars Ivar Hatledal Date: Thu, 29 Feb 2024 11:44:29 +0100 Subject: [PATCH] fix const array and InterleavedBufferAttribute case --- include/threepp/core/BufferAttribute.hpp | 4 ++-- include/threepp/core/InterleavedBufferAttribute.hpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/threepp/core/BufferAttribute.hpp b/include/threepp/core/BufferAttribute.hpp index 872f7ff4..e4064546 100644 --- a/include/threepp/core/BufferAttribute.hpp +++ b/include/threepp/core/BufferAttribute.hpp @@ -100,9 +100,9 @@ namespace threepp { return array_; } - const std::vector& array() const { + virtual const std::vector& array() const { - return array(); + return array_; } TypedBufferAttribute& copyAt(unsigned int index1, const TypedBufferAttribute& attribute, unsigned int index2) { diff --git a/include/threepp/core/InterleavedBufferAttribute.hpp b/include/threepp/core/InterleavedBufferAttribute.hpp index d52fec74..17b2f251 100644 --- a/include/threepp/core/InterleavedBufferAttribute.hpp +++ b/include/threepp/core/InterleavedBufferAttribute.hpp @@ -26,6 +26,11 @@ namespace threepp { return data->array(); } + [[nodiscard]] const std::vector& array() const override { + + return data->array(); + } + [[nodiscard]] int count() const override { return data->count();