2013-11-06 22:52:00 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
// Created by Dan Andersson 2013
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2013-11-10 02:27:16 +01:00
|
|
|
#ifndef OYSTER_COLLISION_3D_LINE_H
|
|
|
|
#define OYSTER_COLLISION_3D_LINE_H
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
|
|
#include "OysterMath.h"
|
|
|
|
#include "ICollideable.h"
|
|
|
|
#include "Ray.h"
|
|
|
|
|
2013-11-10 02:27:16 +01:00
|
|
|
namespace Oyster { namespace Collision3D
|
2013-11-06 22:52:00 +01:00
|
|
|
{
|
|
|
|
class Line : public ICollideable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct { class Ray ray; ::Oyster::Math::Float length; };
|
|
|
|
char byte[sizeof(class Ray) + sizeof(::Oyster::Math::Float)];
|
|
|
|
};
|
|
|
|
|
|
|
|
Line( );
|
|
|
|
Line( const class Ray &ray, const ::Oyster::Math::Float &length );
|
|
|
|
Line( const ::Oyster::Math::Float3 &origin, const ::Oyster::Math::Float3 &normalizedDirection, const ::Oyster::Math::Float &length );
|
2013-11-10 02:27:16 +01:00
|
|
|
virtual ~Line( );
|
2013-11-06 22:52:00 +01:00
|
|
|
|
|
|
|
Line & operator = ( const Line &line );
|
|
|
|
|
2013-11-13 14:50:08 +01:00
|
|
|
virtual ::Utility::DynamicMemory::UniquePointer<ICollideable> Clone( ) const;
|
2013-11-25 14:22:38 +01:00
|
|
|
bool Intersects( const ICollideable &target ) const;
|
2013-12-18 08:57:27 +01:00
|
|
|
bool Intersects( const ICollideable &target, ::Oyster::Math::Float4 &worldPointOfContact ) const;
|
2013-11-25 14:22:38 +01:00
|
|
|
bool Contains( const ICollideable &target ) const;
|
2014-02-03 15:48:42 +01:00
|
|
|
|
|
|
|
::Oyster::Math::Float TimeOfContact( const ICollideable &deuterStart, const ICollideable &deuterEnd ) const;
|
2013-11-06 22:52:00 +01:00
|
|
|
};
|
|
|
|
} }
|
|
|
|
|
|
|
|
#endif
|