From 2fd6bc4130af716a374ae2a13bccccce2a1a2876 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 14 Mar 2018 10:24:44 -0700 Subject: [PATCH] rename Mesh api getPos3 to getPos, deprecate but still support getPos3 --- libraries/graphics/src/graphics/Geometry.h | 2 +- .../src/model-networking/SimpleMeshProxy.cpp | 4 ++-- .../model-networking/src/model-networking/SimpleMeshProxy.h | 4 ++-- libraries/shared/src/RegisteredMetaTypes.h | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libraries/graphics/src/graphics/Geometry.h b/libraries/graphics/src/graphics/Geometry.h index a75fb1bf62..485542d26b 100755 --- a/libraries/graphics/src/graphics/Geometry.h +++ b/libraries/graphics/src/graphics/Geometry.h @@ -74,7 +74,7 @@ public: size_t getNumIndices() const { return _indexBuffer.getNumElements(); } // Access vertex position value - const Vec3& getPos3(Index index) const { return _vertexBuffer.get(index); } + const Vec3& getPos(Index index) const { return _vertexBuffer.get(index); } enum Topology { POINTS = 0, diff --git a/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp b/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp index 741478789e..8f3d1ffec1 100644 --- a/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp +++ b/libraries/model-networking/src/model-networking/SimpleMeshProxy.cpp @@ -21,7 +21,7 @@ int SimpleMeshProxy::getNumVertices() const { return (int)_mesh->getNumVertices(); } -glm::vec3 SimpleMeshProxy::getPos3(int index) const { - return _mesh->getPos3(index); +glm::vec3 SimpleMeshProxy::getPos(int index) const { + return _mesh->getPos(index); } diff --git a/libraries/model-networking/src/model-networking/SimpleMeshProxy.h b/libraries/model-networking/src/model-networking/SimpleMeshProxy.h index 24c3fca27e..073eb1c00f 100644 --- a/libraries/model-networking/src/model-networking/SimpleMeshProxy.h +++ b/libraries/model-networking/src/model-networking/SimpleMeshProxy.h @@ -26,8 +26,8 @@ public: int getNumVertices() const override; - glm::vec3 getPos3(int index) const override; - + glm::vec3 getPos(int index) const override; + glm::vec3 getPos3(int index) const override { return getPos(index); } // deprecated protected: const MeshPointer _mesh; diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h index 4fee78a0db..78e368748b 100644 --- a/libraries/shared/src/RegisteredMetaTypes.h +++ b/libraries/shared/src/RegisteredMetaTypes.h @@ -363,12 +363,13 @@ public: /**jsdoc * Get the position of a vertex in the mesh. - * @function MeshProxy#getPos3 + * @function MeshProxy#getPos * @param {number} index - Integer index of the mesh vertex. * @returns {Vec3} Local position of the vertex relative to the mesh. * @deprecated Use the {@link Graphics} API instead. */ - Q_INVOKABLE virtual glm::vec3 getPos3(int index) const = 0; + Q_INVOKABLE virtual glm::vec3 getPos(int index) const = 0; + Q_INVOKABLE virtual glm::vec3 getPos3(int index) const { return getPos(index); } // deprecated }; Q_DECLARE_METATYPE(MeshProxy*);