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) ); }
|
|
|
|
|
2013-11-25 14:22:38 +01:00
|
|
|
bool Universe::Intersects( const ICollideable &target ) const
|
2013-11-10 02:27:16 +01:00
|
|
|
{ // universe touches everything
|
2013-11-25 14:22:38 +01:00
|
|
|
switch( target.type )
|
2013-11-10 02:27:16 +01:00
|
|
|
{
|
|
|
|
case Type_ray:
|
2013-11-25 14:22:38 +01:00
|
|
|
((Ray*)&target)->collisionDistance = 0.0f;
|
2013-11-10 02:27:16 +01:00
|
|
|
break;
|
|
|
|
case Type_line:
|
2013-11-25 14:22:38 +01:00
|
|
|
((Line*)&target)->ray.collisionDistance = 0.0f;
|
2013-11-10 02:27:16 +01:00
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-11-25 14:22:38 +01:00
|
|
|
bool Universe::Contains( const ICollideable &target ) const
|
2013-11-10 02:27:16 +01:00
|
|
|
{ return true; } // universe contains everything
|
|
|
|
|