diff --git a/OysterPhysics3D/Collision/Box.h b/OysterPhysics3D/Collision/Box.h index 8e60b875..be7b29ad 100644 --- a/OysterPhysics3D/Collision/Box.h +++ b/OysterPhysics3D/Collision/Box.h @@ -3,13 +3,13 @@ ///////////////////////////////////////////////////////////////////// #pragma once -#ifndef OYSTER_COLLISION_BOX_H -#define OYSTER_COLLISION_BOX_H +#ifndef OYSTER_COLLISION_3D_BOX_H +#define OYSTER_COLLISION_3D_BOX_H #include "OysterMath.h" #include "ICollideable.h" -namespace Oyster { namespace Collision +namespace Oyster { namespace Collision3D { class Box : public ICollideable { @@ -28,16 +28,14 @@ namespace Oyster { namespace Collision }; Box( ); - Box( const Box &box ); Box( const ::Oyster::Math::Float4x4 &orientation, const ::Oyster::Math::Float3 &size ); - ~Box( ); + virtual ~Box( ); Box & operator = ( const Box &box ); - ICollideable* clone( ) const; + virtual ::Utility::Memory::UniquePointer Clone( ) const; bool Intersects( const ICollideable *target ) const; bool Contains( const ICollideable *target ) const; - ICollideable::State Advanced( const ICollideable *target ) const; //Not supported returns 0; }; } } diff --git a/OysterPhysics3D/Collision/BoxAxisAligned.h b/OysterPhysics3D/Collision/BoxAxisAligned.h index 712f75fb..e3c91722 100644 --- a/OysterPhysics3D/Collision/BoxAxisAligned.h +++ b/OysterPhysics3D/Collision/BoxAxisAligned.h @@ -3,13 +3,13 @@ ///////////////////////////////////////////////////////////////////// #pragma once -#ifndef OYSTER_COLLISION_BOXAXISALIGNED_H -#define OYSTER_COLLISION_BOXAXISALIGNED_H +#ifndef OYSTER_COLLISION_3D_BOXAXISALIGNED_H +#define OYSTER_COLLISION_3D_BOXAXISALIGNED_H #include "OysterMath.h" #include "ICollideable.h" -namespace Oyster { namespace Collision +namespace Oyster { namespace Collision3D { class BoxAxisAligned : public ICollideable { @@ -21,17 +21,15 @@ namespace Oyster { namespace Collision }; BoxAxisAligned( ); - BoxAxisAligned( const BoxAxisAligned &box ); BoxAxisAligned( const ::Oyster::Math::Float3 &minVertex, const ::Oyster::Math::Float3 &maxVertex ); BoxAxisAligned( const ::Oyster::Math::Float &leftClip, const ::Oyster::Math::Float &rightClip, const ::Oyster::Math::Float &topClip, const ::Oyster::Math::Float &bottomClip, const ::Oyster::Math::Float &nearClip, const ::Oyster::Math::Float &farClip ); - ~BoxAxisAligned( ); + virtual ~BoxAxisAligned( ); BoxAxisAligned & operator = ( const BoxAxisAligned &box ); - ICollideable* clone( ) const; + virtual ::Utility::Memory::UniquePointer Clone( ) const; bool Intersects( const ICollideable *target ) const; bool Contains( const ICollideable *target ) const; - ICollideable::State Advanced( const ICollideable *target ) const; //Not supported returns 0; }; } } diff --git a/OysterPhysics3D/Collision/ICollideable.h b/OysterPhysics3D/Collision/ICollideable.h index 08b69596..4e59e841 100644 --- a/OysterPhysics3D/Collision/ICollideable.h +++ b/OysterPhysics3D/Collision/ICollideable.h @@ -3,10 +3,11 @@ // Edited by Dan Andersson 2013 ///////////////////////////////////////////////////////////////////// -#pragma once #ifndef OYSTER_COLLISION_3D_ICOLLIDEABLE_H #define OYSTER_COLLISION_3D_ICOLLIDEABLE_H +#include "Utilities.h" + namespace Oyster { namespace Collision3D /// Contains a collection of 3D shapes and intercollission algorithms. { class ICollideable @@ -31,7 +32,7 @@ namespace Oyster { namespace Collision3D /// Contains a collection of 3D shapes ICollideable( Type type = Type_undefined ); - virtual ICollideable* clone( ) const = 0; // TODO: use smart unique pointer here + virtual ::Utility::Memory::UniquePointer Clone( ) const = 0; virtual bool Intersects( const ICollideable *target ) const = 0; virtual bool Contains( const ICollideable *target ) const = 0; }; diff --git a/OysterPhysics3D/Collision/Sphere.h b/OysterPhysics3D/Collision/Sphere.h index b33ad216..9d8c4c8f 100644 --- a/OysterPhysics3D/Collision/Sphere.h +++ b/OysterPhysics3D/Collision/Sphere.h @@ -3,13 +3,13 @@ ///////////////////////////////////////////////////////////////////// #pragma once -#ifndef OYSTER_COLLISION_SPHERE_H -#define OYSTER_COLLISION_SPHERE_H +#ifndef OYSTER_COLLISION_3D_SPHERE_H +#define OYSTER_COLLISION_3D_SPHERE_H #include "OysterMath.h" #include "ICollideable.h" -namespace Oyster { namespace Collision +namespace Oyster { namespace Collision3D { class Sphere : public ICollideable { @@ -21,16 +21,14 @@ namespace Oyster { namespace Collision }; Sphere( ); - Sphere( const Sphere &point ); - Sphere( const ::Oyster::Math::Float3 &position, const ::Oyster::Math::Float &radius ); - ~Sphere( ); + Sphere( const ::Oyster::Math::Float3 ¢er, const ::Oyster::Math::Float &radius ); + virtual ~Sphere( ); Sphere & operator = ( const Sphere &sphere ); - ICollideable* clone( ) const; + virtual ::Utility::Memory::UniquePointer Clone( ) const; bool Intersects( const ICollideable *target ) const; bool Contains( const ICollideable *target ) const; - ICollideable::State Advanced( const ICollideable *target ) const; //Not supported returns 0; }; } }