Frustrum fix

This commit is contained in:
Dander7BD 2013-11-11 21:14:52 +01:00
parent 4f14c5662e
commit f0b464bccf
4 changed files with 18 additions and 5 deletions

View File

@ -3,7 +3,7 @@
/////////////////////////////////////////////////////////////////////
#include "Frustrum.h"
#include "OysterCollision.h"
#include "..\OysterCollision3D.h"
using namespace Oyster::Math;
using namespace Oyster::Collision3D;
@ -74,7 +74,7 @@ namespace PrivateStatic
}
}
Frustrum::Frustrum( ) : ICollideable(Type_frustrum),
Frustrum::Frustrum() : ICollideable(Type_frustrum),
leftPlane(Float3::standard_unit_x, -0.5f), rightPlane(-Float3::standard_unit_x, 0.5f),
bottomPlane(Float3::standard_unit_y, -0.5f), topPlane(-Float3::standard_unit_y, 0.5f),
nearPlane(Float3::standard_unit_z, -0.5f), farPlane(-Float3::standard_unit_z, 0.5f) {}
@ -82,7 +82,7 @@ Frustrum::Frustrum( ) : ICollideable(Type_frustrum),
Frustrum::Frustrum( const Float4x4 &vp ) : ICollideable(Type_frustrum)
{ PrivateStatic::VP_ToPlanes( this->leftPlane, this->rightPlane, this->bottomPlane, this->topPlane, this->nearPlane, this->farPlane, vp ); }
Frustrum::~Frustrum( ) {}
Frustrum::~Frustrum() {}
Frustrum & Frustrum::operator = ( const Frustrum &frustrum )
{

View File

@ -24,9 +24,9 @@ namespace Oyster { namespace Collision3D
{ class Plane leftPlane, rightPlane, bottomPlane, topPlane, nearPlane, farPlane; };
};
Frustrum( );
Frustrum();
Frustrum( const ::Oyster::Math::Float4x4 &viewProjection );
virtual ~Frustrum( );
virtual ~Frustrum();
Frustrum & operator = ( const Frustrum &frustrum );
Frustrum & operator = ( const ::Oyster::Math::Float4x4 &viewProjection );

View File

@ -0,0 +1,12 @@
/////////////////////////////////////////////////////////////////////
// Created by Dan Andersson 2013
/////////////////////////////////////////////////////////////////////
#include "ICollideable.h"
using namespace ::Oyster::Collision3D;
ICollideable::ICollideable( Type _type )
: type(_type) {}
ICollideable::~ICollideable() {}

View File

@ -31,6 +31,7 @@ namespace Oyster { namespace Collision3D /// Contains a collection of 3D shapes
const Type type;
ICollideable( Type type = Type_undefined );
virtual ~ICollideable();
virtual ::Utility::Memory::UniquePointer<ICollideable> Clone( ) const = 0;
virtual bool Intersects( const ICollideable *target ) const = 0;