2013-11-10 02:27:16 +01:00
|
|
|
#include "Universe.h"
|
2013-11-12 12:33:52 +01:00
|
|
|
#include "OysterCollision3D.h"
|
2013-11-10 02:27:16 +01:00
|
|
|
|
|
|
|
using namespace ::Oyster::Collision3D;
|
2013-11-13 14:50:08 +01:00
|
|
|
using namespace ::Utility::DynamicMemory;
|
2013-11-10 02:27:16 +01:00
|
|
|
|
|
|
|
Universe::Universe() : ICollideable(Type_universe) {}
|
|
|
|
Universe::~Universe() {}
|
|
|
|
|
|
|
|
Universe & Universe::operator = ( const Universe &universe )
|
|
|
|
{ return *this; }
|
|
|
|
|
|
|
|
UniquePointer<ICollideable> Universe::Clone( ) const
|
|
|
|
{ return UniquePointer<ICollideable>( new Universe(*this) ); }
|
|
|
|
|
|
|
|
bool Universe::Intersects( const ICollideable *target ) const
|
|
|
|
{ // universe touches everything
|
|
|
|
switch( target->type )
|
|
|
|
{
|
|
|
|
case Type_ray:
|
|
|
|
((Ray*)target)->collisionDistance = 0.0f;
|
|
|
|
break;
|
|
|
|
case Type_line:
|
|
|
|
((Line*)target)->ray.collisionDistance = 0.0f;
|
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-11-12 00:10:48 +01:00
|
|
|
bool Universe::Contains( const ICollideable *target ) const
|
2013-11-10 02:27:16 +01:00
|
|
|
{ return true; } // universe contains everything
|
|
|
|
|