Merge branch 'Collision3D'
This commit is contained in:
commit
a16f311751
|
@ -4,46 +4,36 @@
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef OYSTER_COLLISION_ICOLLIDEABLE_H
|
#ifndef OYSTER_COLLISION_3D_ICOLLIDEABLE_H
|
||||||
#define OYSTER_COLLISION_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
|
class ICollideable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum CollisionType
|
enum Type
|
||||||
{
|
{
|
||||||
Point,
|
Type_undefined,
|
||||||
Ray,
|
Type_universe,
|
||||||
Sphere,
|
Type_point,
|
||||||
Plane,
|
Type_ray,
|
||||||
Triangle,
|
Type_sphere,
|
||||||
BoxAxisAligned,
|
Type_plane,
|
||||||
Box,
|
Type_triangle,
|
||||||
Frustrum,
|
Type_box_axis_aligned,
|
||||||
Line
|
Type_box,
|
||||||
|
Type_frustrum,
|
||||||
|
Type_line
|
||||||
};
|
};
|
||||||
|
|
||||||
enum State
|
const Type type;
|
||||||
{
|
|
||||||
Missed = 0,
|
|
||||||
Contained,
|
|
||||||
Intersected
|
|
||||||
};
|
|
||||||
|
|
||||||
ICollideable( CollisionType _type ) : type(_type) {};
|
ICollideable( Type type = Type_undefined );
|
||||||
|
|
||||||
const CollisionType type;
|
|
||||||
|
|
||||||
virtual ICollideable* clone( ) const = 0;
|
|
||||||
|
|
||||||
|
virtual ICollideable* clone( ) const = 0; // TODO: use smart unique pointer here
|
||||||
virtual bool Intersects( const ICollideable *target ) const = 0;
|
virtual bool Intersects( const ICollideable *target ) const = 0;
|
||||||
|
|
||||||
virtual bool Contains( 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
|
#endif
|
|
@ -13,69 +13,81 @@
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
<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>
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
</Filter>
|
</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>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Collision\Box.cpp">
|
<ClCompile Include="Collision\Box.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\BoxAxisAligned.cpp">
|
<ClCompile Include="Collision\BoxAxisAligned.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Collision.cpp">
|
<ClCompile Include="Collision\Collision.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Frustrum.cpp">
|
<ClCompile Include="Collision\Frustrum.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Line.cpp">
|
<ClCompile Include="Collision\Line.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Plane.cpp">
|
<ClCompile Include="Collision\Plane.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Point.cpp">
|
<ClCompile Include="Collision\Point.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Ray.cpp">
|
<ClCompile Include="Collision\Ray.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Collision\Sphere.cpp">
|
<ClCompile Include="Collision\Sphere.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\Collision</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Collision\Box.h">
|
<ClInclude Include="Collision\Box.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\BoxAxisAligned.h">
|
<ClInclude Include="Collision\BoxAxisAligned.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Collision.h">
|
<ClInclude Include="Collision\Collision.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Frustrum.h">
|
<ClInclude Include="Collision\Frustrum.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\ICollideable.h">
|
<ClInclude Include="Collision\ICollideable.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Line.h">
|
<ClInclude Include="Collision\Line.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\OysterCollision.h">
|
<ClInclude Include="Collision\OysterCollision.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Plane.h">
|
<ClInclude Include="Collision\Plane.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Point.h">
|
<ClInclude Include="Collision\Point.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Ray.h">
|
<ClInclude Include="Collision\Ray.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Collision\Sphere.h">
|
<ClInclude Include="Collision\Sphere.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\Collision</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue