From bddc3acad2dcc6a55b6bc7f1413d207d7bea6d7e Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Fri, 29 Nov 2013 09:07:52 +0100 Subject: [PATCH] Changed from pointer to reference Did it in sample and visit functions --- Code/GamePhysics/Implementation/Octree.cpp | 8 ++++---- Code/GamePhysics/Implementation/Octree.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/GamePhysics/Implementation/Octree.cpp b/Code/GamePhysics/Implementation/Octree.cpp index 70d2842a..1da6045b 100644 --- a/Code/GamePhysics/Implementation/Octree.cpp +++ b/Code/GamePhysics/Implementation/Octree.cpp @@ -94,11 +94,11 @@ std::vector& Octree::Sample(ICustomBody* customBodyRef, std::vecto return updateList; } -std::vector& Octree::Sample(::Collision3D::ICollideable* collideable, std::vector& updateList) +std::vector& Octree::Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector& updateList) { for(unsigned int i = 0; ileafData.size(); i++) { - if(this->leafData[i].container.Intersects(*collideable)) + if(this->leafData[i].container.Intersects(collideable)) { updateList.push_back(this->leafData[i].customBodyRef); } @@ -127,11 +127,11 @@ void Octree::Visit(ICustomBody* customBodyRef, VistorAction hitAction ) } } -void Octree::Visit(::Collision3D::ICollideable* collideable, VistorAction hitAction) +void Octree::Visit(const Oyster::Collision3D::ICollideable& collideable, VistorAction hitAction) { for(unsigned int i = 0; ileafData.size(); i++) { - if(this->leafData[i].container.Intersects(*collideable)) + if(this->leafData[i].container.Intersects(collideable)) { //hitAction(*this, tempRef, i); // @todo TODO: Add typedef to handle function calls with ICollideable } diff --git a/Code/GamePhysics/Implementation/Octree.h b/Code/GamePhysics/Implementation/Octree.h index 6340fa58..96631605 100644 --- a/Code/GamePhysics/Implementation/Octree.h +++ b/Code/GamePhysics/Implementation/Octree.h @@ -50,9 +50,9 @@ namespace Oyster void DestroyObject(::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef); std::vector& Sample(ICustomBody* customBodyRef, std::vector& updateList); - std::vector& Sample(Oyster::Collision3D::ICollideable* collideable, std::vector& updateList); + std::vector& Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector& updateList); void Visit(ICustomBody* customBodyRef, VistorAction hitAction ); - void Visit(Oyster::Collision3D::ICollideable* collideable, VistorAction hitAction ); + void Visit(const Oyster::Collision3D::ICollideable& collideable, VistorAction hitAction ); ICustomBody* GetCustomBody(const unsigned int tempRef);