2014-02-12 10:16:00 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
// Created by Erik Persson 2014
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "Cone.h"
|
|
|
|
#include "OysterCollision3D.h"
|
|
|
|
|
|
|
|
using namespace ::Oyster::Collision3D;
|
|
|
|
using namespace ::Oyster::Math3D;
|
|
|
|
|
|
|
|
|
|
|
|
Cone::Cone( ) : ICollideable(Type_cone)
|
|
|
|
{
|
2014-02-12 12:38:52 +01:00
|
|
|
this->center = Float3(0, 0, 0);
|
|
|
|
this->quaternion = Float4(0, 0, 0, 1);
|
2014-02-12 10:16:00 +01:00
|
|
|
this->radius = 1;
|
2014-02-12 12:38:52 +01:00
|
|
|
this->length = 0;
|
2014-02-12 10:16:00 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 12:38:52 +01:00
|
|
|
Cone & Cone::operator = ( const Cone &Cone )
|
2014-02-12 10:16:00 +01:00
|
|
|
{
|
2014-02-12 12:38:52 +01:00
|
|
|
this->center = Cone.center;
|
|
|
|
this->quaternion = Cone.quaternion;
|
|
|
|
this->radius = Cone.radius;
|
|
|
|
this->length = Cone.length;
|
|
|
|
|
|
|
|
return *this;
|
2014-02-12 10:16:00 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 12:38:52 +01:00
|
|
|
Cone::Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float3 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone)
|
2014-02-12 10:16:00 +01:00
|
|
|
{
|
2014-02-12 12:38:52 +01:00
|
|
|
this->center = position;
|
|
|
|
this->quaternion = quaternion;
|
2014-02-12 10:16:00 +01:00
|
|
|
this->radius = radius;
|
2014-02-12 12:38:52 +01:00
|
|
|
this->length = height;
|
2014-02-12 10:16:00 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 12:38:52 +01:00
|
|
|
Cone::Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float4 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone)
|
2014-02-12 10:16:00 +01:00
|
|
|
{
|
2014-02-12 12:38:52 +01:00
|
|
|
this->center = position;
|
|
|
|
this->quaternion = quaternion;
|
|
|
|
this->radius = radius;
|
|
|
|
this->length = height;
|
2014-02-12 10:16:00 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 12:38:52 +01:00
|
|
|
Cone::~Cone( )
|
2014-02-12 10:16:00 +01:00
|
|
|
{
|
2014-02-12 12:38:52 +01:00
|
|
|
|
2014-02-12 10:16:00 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 11:32:30 +01:00
|
|
|
::Utility::DynamicMemory::UniquePointer<ICollideable> Cone::Clone( ) const
|
|
|
|
{
|
|
|
|
return ::Utility::DynamicMemory::UniquePointer<ICollideable>( new Cone(*this) );
|
|
|
|
}
|
|
|
|
|