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
|
|
|
|
{
|
2013-11-20 16:58:56 +01:00
|
|
|
struct{ ::Oyster::Math::Float4x4 rotation; ::Oyster::Math::Float3 center, boundingOffset; };
|
2013-11-06 22:52:00 +01:00
|
|
|
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;
|
|
|
|
};
|
2013-11-20 16:58:56 +01:00
|
|
|
char byte[sizeof(::Oyster::Math::Float4x4) + 2*sizeof(::Oyster::Math::Float3)];
|
2013-11-06 22:52:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Box( );
|
2013-11-20 16:58:56 +01:00
|
|
|
Box( const ::Oyster::Math::Float4x4 &rotation, const ::Oyster::Math::Float3 &worldPos, 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-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
|