2013-11-06 22:52:00 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
// Created by Dan Andersson 2013
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2013-11-10 02:28:07 +01:00
|
|
|
#ifndef OYSTER_COLLISION_3D_BOXAXISALIGNED_H
|
|
|
|
#define OYSTER_COLLISION_3D_BOXAXISALIGNED_H
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
|
|
#include "OysterMath.h"
|
|
|
|
#include "ICollideable.h"
|
|
|
|
|
2013-11-10 02:28:07 +01:00
|
|
|
namespace Oyster { namespace Collision3D
|
2013-11-06 22:52:00 +01:00
|
|
|
{
|
|
|
|
class BoxAxisAligned : public ICollideable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct{ ::Oyster::Math::Float3 minVertex, maxVertex; };
|
|
|
|
char byte[2*sizeof(::Oyster::Math::Float3)];
|
|
|
|
};
|
|
|
|
|
|
|
|
BoxAxisAligned( );
|
|
|
|
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 );
|
2013-11-10 02:28:07 +01:00
|
|
|
virtual ~BoxAxisAligned( );
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
|
|
BoxAxisAligned & operator = ( const BoxAxisAligned &box );
|
|
|
|
|
2013-11-13 14:50:08 +01:00
|
|
|
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
|
2013-11-06 22:52:00 +01:00
|
|
|
bool Intersects( const ICollideable *target ) const;
|
|
|
|
bool Contains( const ICollideable *target ) const;
|
|
|
|
};
|
|
|
|
} }
|
|
|
|
|
|
|
|
#endif
|