From 4bef8260abcfe137bd206262e980b0249d041143 Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Fri, 1 Sep 2017 23:02:19 +0200 Subject: [PATCH] Add const qualifiers --- components/sceneutil/morphgeometry.cpp | 2 +- components/sceneutil/riggeometry.cpp | 6 +++--- components/sceneutil/riggeometry.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/sceneutil/morphgeometry.cpp b/components/sceneutil/morphgeometry.cpp index 5d55e75ec..4c53b68a5 100644 --- a/components/sceneutil/morphgeometry.cpp +++ b/components/sceneutil/morphgeometry.cpp @@ -31,7 +31,7 @@ void MorphGeometry::setSourceGeometry(osg::ref_ptr sourceGeom) { mGeometry[i] = new osg::Geometry(*mSourceGeometry, osg::CopyOp::SHALLOW_COPY); - osg::Geometry& from = *mSourceGeometry; + const osg::Geometry& from = *mSourceGeometry; osg::Geometry& to = *mGeometry[i]; to.setSupportsDisplayList(false); to.setUseVertexBufferObjects(true); diff --git a/components/sceneutil/riggeometry.cpp b/components/sceneutil/riggeometry.cpp index ec01f62d0..f3eea1bbd 100644 --- a/components/sceneutil/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -35,7 +35,7 @@ void RigGeometry::setSourceGeometry(osg::ref_ptr sourceGeometry) for (unsigned int i=0; i<2; ++i) { - osg::Geometry& from = *sourceGeometry; + const osg::Geometry& from = *sourceGeometry; mGeometry[i] = new osg::Geometry(from, osg::CopyOp::SHALLOW_COPY); osg::Geometry& to = *mGeometry[i]; to.setSupportsDisplayList(false); @@ -54,7 +54,7 @@ void RigGeometry::setSourceGeometry(osg::ref_ptr sourceGeometry) to.setVertexArray(vertexArray); } - if (osg::Array* normals = from.getNormalArray()) + if (const osg::Array* normals = from.getNormalArray()) { osg::ref_ptr normalArray = osg::clone(normals, osg::CopyOp::DEEP_COPY_ALL); if (normalArray) @@ -64,7 +64,7 @@ void RigGeometry::setSourceGeometry(osg::ref_ptr sourceGeometry) } } - if (osg::Vec4Array* tangents = dynamic_cast(from.getTexCoordArray(7))) + if (const osg::Vec4Array* tangents = dynamic_cast(from.getTexCoordArray(7))) { mSourceTangents = tangents; osg::ref_ptr tangentArray = osg::clone(tangents, osg::CopyOp::DEEP_COPY_ALL); diff --git a/components/sceneutil/riggeometry.hpp b/components/sceneutil/riggeometry.hpp index 097e7ea69..638f53679 100644 --- a/components/sceneutil/riggeometry.hpp +++ b/components/sceneutil/riggeometry.hpp @@ -57,7 +57,7 @@ namespace SceneUtil osg::Geometry* getGeometry(unsigned int frame) const; osg::ref_ptr mSourceGeometry; - osg::ref_ptr mSourceTangents; + osg::ref_ptr mSourceTangents; Skeleton* mSkeleton; osg::ref_ptr mGeomToSkelMatrix;