rename Mesh api getPos3 to getPos, deprecate but still support getPos3

This commit is contained in:
Seth Alves 2018-03-14 10:24:44 -07:00
parent 2487e34ee8
commit 2fd6bc4130
4 changed files with 8 additions and 7 deletions

View file

@ -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<Vec3>(index); }
const Vec3& getPos(Index index) const { return _vertexBuffer.get<Vec3>(index); }
enum Topology {
POINTS = 0,

View file

@ -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);
}

View file

@ -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;

View file

@ -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*);