Merge branch 'Collision3D'
This commit is contained in:
commit
a16f311751
|
@ -4,46 +4,36 @@
|
|||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
#ifndef OYSTER_COLLISION_ICOLLIDEABLE_H
|
||||
#define OYSTER_COLLISION_ICOLLIDEABLE_H
|
||||
#ifndef OYSTER_COLLISION_3D_ICOLLIDEABLE_H
|
||||
#define OYSTER_COLLISION_3D_ICOLLIDEABLE_H
|
||||
|
||||
namespace Oyster { namespace Collision
|
||||
namespace Oyster { namespace Collision3D /// Contains a collection of 3D shapes and intercollission algorithms.
|
||||
{
|
||||
class ICollideable
|
||||
{
|
||||
public:
|
||||
enum CollisionType
|
||||
enum Type
|
||||
{
|
||||
Point,
|
||||
Ray,
|
||||
Sphere,
|
||||
Plane,
|
||||
Triangle,
|
||||
BoxAxisAligned,
|
||||
Box,
|
||||
Frustrum,
|
||||
Line
|
||||
Type_undefined,
|
||||
Type_universe,
|
||||
Type_point,
|
||||
Type_ray,
|
||||
Type_sphere,
|
||||
Type_plane,
|
||||
Type_triangle,
|
||||
Type_box_axis_aligned,
|
||||
Type_box,
|
||||
Type_frustrum,
|
||||
Type_line
|
||||
};
|
||||
|
||||
enum State
|
||||
{
|
||||
Missed = 0,
|
||||
Contained,
|
||||
Intersected
|
||||
};
|
||||
const Type type;
|
||||
|
||||
ICollideable( CollisionType _type ) : type(_type) {};
|
||||
|
||||
const CollisionType type;
|
||||
|
||||
virtual ICollideable* clone( ) const = 0;
|
||||
ICollideable( Type type = Type_undefined );
|
||||
|
||||
virtual ICollideable* clone( ) const = 0; // TODO: use smart unique pointer here
|
||||
virtual bool Intersects( const ICollideable *target ) const = 0;
|
||||
|
||||
virtual bool Contains( const ICollideable *target ) const = 0;
|
||||
|
||||
//Not supported returns 0;
|
||||
virtual State Advanced( const ICollideable *target ) const = 0;
|
||||
};
|
||||
} }
|
||||
#endif
|
|
@ -13,69 +13,81 @@
|
|||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Collision">
|
||||
<UniqueIdentifier>{810a1ae3-6c3b-430a-8ebb-4fc4a4478717}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Collision">
|
||||
<UniqueIdentifier>{512d69ae-c260-4a23-b1ee-cbfbd19620a6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Physics">
|
||||
<UniqueIdentifier>{67d78b73-6ad3-439e-bfba-817f0268b958}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Physics">
|
||||
<UniqueIdentifier>{86be9383-5659-4e32-bf71-ec25a5f1c5ac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Collision\Box.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\BoxAxisAligned.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Collision.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Frustrum.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Line.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Plane.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Point.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Ray.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Collision\Sphere.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\Collision</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Collision\Box.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\BoxAxisAligned.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Collision.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Frustrum.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\ICollideable.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Line.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\OysterCollision.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Plane.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Point.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Ray.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Collision\Sphere.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<Filter>Header Files\Collision</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue