Danbias/Code/OysterPhysics3D/Cone.cpp

56 lines
1.4 KiB
C++
Raw Normal View History

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)
{
this->center = Float3(0, 0, 0);
this->quaternion = Float4(0, 0, 0, 1);
2014-02-12 10:16:00 +01:00
this->radius = 1;
this->length = 0;
2014-02-12 10:16:00 +01:00
}
Cone & Cone::operator = ( const Cone &Cone )
2014-02-12 10:16:00 +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
}
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
{
this->center = position;
this->quaternion = quaternion;
2014-02-12 10:16:00 +01:00
this->radius = radius;
this->length = height;
2014-02-12 10:16:00 +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
{
this->center = position;
this->quaternion = quaternion;
this->radius = radius;
this->length = height;
2014-02-12 10:16:00 +01:00
}
Cone::~Cone( )
2014-02-12 10:16:00 +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) );
}