diff --git a/include/ISceneCollisionManager.h b/include/ISceneCollisionManager.h index 067581f2..7e59fdcf 100644 --- a/include/ISceneCollisionManager.h +++ b/include/ISceneCollisionManager.h @@ -30,7 +30,7 @@ namespace scene core::triangle3df Triangle; //! Triangle selector which contained the colliding triangle (useful when having MetaTriangleSelector) - ITriangleSelector* TriangleSelector; + const ITriangleSelector* TriangleSelector; //! Node which contained the triangle (is 0 when selector doesn't have that information) ISceneNode* Node; diff --git a/include/ITriangleSelector.h b/include/ITriangleSelector.h index dcc73333..8ae226b8 100644 --- a/include/ITriangleSelector.h +++ b/include/ITriangleSelector.h @@ -49,7 +49,7 @@ struct SCollisionTriangleRange irr::u32 RangeSize; //! Real selector which contained those triangles (useful when working with MetaTriangleSelector) - ITriangleSelector* Selector; + const ITriangleSelector* Selector; //! SceneNode from which the triangles are from ISceneNode* SceneNode; diff --git a/source/Irrlicht/COctreeTriangleSelector.cpp b/source/Irrlicht/COctreeTriangleSelector.cpp index a7627463..50c6ff4b 100644 --- a/source/Irrlicht/COctreeTriangleSelector.cpp +++ b/source/Irrlicht/COctreeTriangleSelector.cpp @@ -180,7 +180,7 @@ void COctreeTriangleSelector::getTriangles(core::triangle3df* triangles, { SCollisionTriangleRange triRange; triRange.RangeSize = trianglesWritten; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; triRange.MeshBuffer = MeshBuffer; triRange.MaterialIndex = MaterialIndex; @@ -272,7 +272,7 @@ void COctreeTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arr { SCollisionTriangleRange triRange; triRange.RangeSize = trianglesWritten; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; triRange.MeshBuffer = MeshBuffer; triRange.MaterialIndex = MaterialIndex; diff --git a/source/Irrlicht/CTerrainTriangleSelector.cpp b/source/Irrlicht/CTerrainTriangleSelector.cpp index db544d40..2ee697f3 100644 --- a/source/Irrlicht/CTerrainTriangleSelector.cpp +++ b/source/Irrlicht/CTerrainTriangleSelector.cpp @@ -115,7 +115,7 @@ void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, { SCollisionTriangleRange triRange; triRange.RangeSize = tIndex; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; outTriangleInfo->push_back(triRange); } @@ -163,7 +163,7 @@ void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, { SCollisionTriangleRange triRange; triRange.RangeSize = tIndex; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; outTriangleInfo->push_back(triRange); } @@ -209,7 +209,7 @@ void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, { SCollisionTriangleRange triRange; triRange.RangeSize = tIndex; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; outTriangleInfo->push_back(triRange); } diff --git a/source/Irrlicht/CTriangleSelector.cpp b/source/Irrlicht/CTriangleSelector.cpp index 531c62d6..8186950c 100644 --- a/source/Irrlicht/CTriangleSelector.cpp +++ b/source/Irrlicht/CTriangleSelector.cpp @@ -293,7 +293,7 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles, triRange.RangeStart = 0; triRange.RangeSize = cnt; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; triRange.MeshBuffer = MeshBuffer; triRange.MaterialIndex = MaterialIndex; @@ -313,7 +313,7 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles, triRange.MeshBuffer = BufferRanges[rangeIndex].MeshBuffer; triRange.RangeStart = BufferRanges[rangeIndex].RangeStart; triRange.RangeSize = core::min_( cnt-BufferRanges[rangeIndex].RangeStart, BufferRanges[rangeIndex].RangeSize); - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; outTriangleInfo->push_back(triRange); @@ -370,7 +370,7 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles, { irr::u32 activeRange = 0; SCollisionTriangleRange triRange; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; triRange.RangeStart = triangleCount; triRange.MeshBuffer = BufferRanges[activeRange].MeshBuffer; @@ -433,7 +433,7 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles, { SCollisionTriangleRange triRange; triRange.RangeSize = triangleCount; - triRange.Selector = const_cast(this); + triRange.Selector = this; triRange.SceneNode = SceneNode; triRange.MeshBuffer = MeshBuffer; triRange.MaterialIndex = MaterialIndex;