Changed from pointer to reference

Did it in sample and visit functions
This commit is contained in:
Robin Engman 2013-11-29 09:07:52 +01:00
parent 255a0b0070
commit bddc3acad2
2 changed files with 6 additions and 6 deletions

View File

@ -94,11 +94,11 @@ std::vector<ICustomBody*>& Octree::Sample(ICustomBody* customBodyRef, std::vecto
return updateList;
}
std::vector<ICustomBody*>& Octree::Sample(::Collision3D::ICollideable* collideable, std::vector<ICustomBody*>& updateList)
std::vector<ICustomBody*>& Octree::Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector<ICustomBody*>& updateList)
{
for(unsigned int i = 0; i<this->leafData.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; i<this->leafData.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
}

View File

@ -50,9 +50,9 @@ namespace Oyster
void DestroyObject(::Utility::DynamicMemory::UniquePointer< ICustomBody > customBodyRef);
std::vector<ICustomBody*>& Sample(ICustomBody* customBodyRef, std::vector<ICustomBody*>& updateList);
std::vector<ICustomBody*>& Sample(Oyster::Collision3D::ICollideable* collideable, std::vector<ICustomBody*>& updateList);
std::vector<ICustomBody*>& Sample(const Oyster::Collision3D::ICollideable& collideable, std::vector<ICustomBody*>& 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);