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_BOX_H
|
|
|
|
#define OYSTER_COLLISION_3D_BOX_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 Box : public ICollideable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct{ ::Oyster::Math::Float4x4 orientation; ::Oyster::Math::Float3 boundingOffset; };
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
::Oyster::Math::Float3 xAxis; ::Oyster::Math::Float paddingA;
|
|
|
|
::Oyster::Math::Float3 yAxis; ::Oyster::Math::Float paddingB;
|
|
|
|
::Oyster::Math::Float3 zAxis; ::Oyster::Math::Float paddingC;
|
|
|
|
::Oyster::Math::Float3 center;
|
|
|
|
};
|
|
|
|
char byte[sizeof(::Oyster::Math::Float4x4) + sizeof(::Oyster::Math::Float3)];
|
|
|
|
};
|
|
|
|
|
|
|
|
Box( );
|
|
|
|
Box( const ::Oyster::Math::Float4x4 &orientation, const ::Oyster::Math::Float3 &size );
|
2013-11-10 02:28:07 +01:00
|
|
|
virtual ~Box( );
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
|
|
Box & operator = ( const Box &box );
|
|
|
|
|
2013-11-10 02:28:07 +01:00
|
|
|
virtual ::Utility::Memory::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
|