2013-11-06 22:52:00 +01:00
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Created by P<>r Hammarstrand 2013
|
|
|
|
|
// Edited by Dan Andersson 2013
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2013-11-09 23:58:48 +01:00
|
|
|
|
#ifndef OYSTER_COLLISION_3D_ICOLLIDEABLE_H
|
|
|
|
|
#define OYSTER_COLLISION_3D_ICOLLIDEABLE_H
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
2013-11-10 02:28:07 +01:00
|
|
|
|
#include "Utilities.h"
|
|
|
|
|
|
2013-11-09 23:58:48 +01:00
|
|
|
|
namespace Oyster { namespace Collision3D /// Contains a collection of 3D shapes and intercollission algorithms.
|
2013-11-06 22:52:00 +01:00
|
|
|
|
{
|
|
|
|
|
class ICollideable
|
|
|
|
|
{
|
|
|
|
|
public:
|
2013-11-09 23:58:48 +01:00
|
|
|
|
enum Type
|
2013-11-06 22:52:00 +01:00
|
|
|
|
{
|
2013-11-09 23:58:48 +01:00
|
|
|
|
Type_undefined,
|
|
|
|
|
Type_universe,
|
|
|
|
|
Type_point,
|
|
|
|
|
Type_ray,
|
|
|
|
|
Type_sphere,
|
|
|
|
|
Type_plane,
|
2013-11-20 13:48:54 +01:00
|
|
|
|
// Type_triangle,
|
2013-11-09 23:58:48 +01:00
|
|
|
|
Type_box_axis_aligned,
|
|
|
|
|
Type_box,
|
|
|
|
|
Type_frustrum,
|
|
|
|
|
Type_line
|
2013-11-06 22:52:00 +01:00
|
|
|
|
};
|
|
|
|
|
|
2013-11-09 23:58:48 +01:00
|
|
|
|
const Type type;
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
2013-11-09 23:58:48 +01:00
|
|
|
|
ICollideable( Type type = Type_undefined );
|
2013-11-11 21:14:52 +01:00
|
|
|
|
virtual ~ICollideable();
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
2013-11-13 14:50:08 +01:00
|
|
|
|
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const = 0;
|
2013-11-06 22:52:00 +01:00
|
|
|
|
virtual bool Intersects( const ICollideable *target ) const = 0;
|
|
|
|
|
virtual bool Contains( const ICollideable *target ) const = 0;
|
|
|
|
|
};
|
|
|
|
|
} }
|
|
|
|
|
#endif
|