Add project files.
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
#include "iVector2.hpp"
|
||||
|
||||
/*** Custom Header File ***/
|
||||
#include "../Vector/Vector2.hpp"
|
||||
|
||||
using MathEngine::iVector2;
|
||||
using MathEngine::Vector2;
|
||||
|
||||
iVector2::iVector2( const int X /*= 0*/, const int Y /*= 0*/ )
|
||||
: x(X), y(Y)
|
||||
{}
|
||||
|
||||
iVector2::iVector2( const Vector2& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
}
|
||||
|
||||
iVector2::iVector2( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator = ( const Vector2& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector2::operator == ( const iVector2& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if (x == other.x)
|
||||
if (y == other.y)
|
||||
rtn = true;
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
bool iVector2::operator == ( const SDL_Rect& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if (x == other.x)
|
||||
if (y == other.y)
|
||||
rtn = true;
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator += ( const iVector2& other )
|
||||
{
|
||||
x += int(other.x);
|
||||
y += int(other.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator += ( const SDL_Rect& other )
|
||||
{
|
||||
x += int(other.x);
|
||||
y += int(other.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator -= (const iVector2& other)
|
||||
{
|
||||
x -= int(other.x);
|
||||
y -= int(other.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator -= (const SDL_Rect& other)
|
||||
{
|
||||
x -= int(other.x);
|
||||
y -= int(other.y);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2 operator + (const iVector2& lhs, const iVector2& rhs)
|
||||
{
|
||||
iVector2 rs = lhs;
|
||||
rs += rhs;
|
||||
return rs;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef _IVECTOR2_HPP_
|
||||
#define _IVECTOR2_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
namespace MathEngine {
|
||||
struct Vector2;
|
||||
|
||||
struct EXPORT_FROM_MYDLL iVector2
|
||||
{
|
||||
iVector2( const int X = 0, const int Y = 0 );
|
||||
iVector2( const Vector2& copy );
|
||||
iVector2( const SDL_Rect& copy );
|
||||
|
||||
iVector2& operator = ( const Vector2& copy );
|
||||
iVector2& operator = ( const SDL_Rect& copy );
|
||||
|
||||
bool operator == ( const iVector2& other ) const;
|
||||
bool operator == ( const SDL_Rect& other ) const;
|
||||
|
||||
iVector2& operator += ( const iVector2& other );
|
||||
iVector2& operator += ( const SDL_Rect& other );
|
||||
|
||||
iVector2& operator -= (const iVector2& other);
|
||||
iVector2& operator -= (const SDL_Rect& other);
|
||||
|
||||
iVector2& operator + ( const iVector2& other );
|
||||
iVector2& operator + ( const SDL_Rect& other );
|
||||
|
||||
int x;
|
||||
int y;
|
||||
};/// END STRUCT DEFINITION iVector2
|
||||
}/// END NAMESPACE DEFINITION MathEngine
|
||||
MathEngine::iVector2 operator + (const MathEngine::iVector2& lhs, const MathEngine::iVector2& rhs);
|
||||
#endif/// END IFNDEF _IVECTOR2_HPP_
|
||||
@@ -0,0 +1,67 @@
|
||||
#include "iVector3.hpp"
|
||||
|
||||
/*** Custom Header File ***/
|
||||
#include "../Vector/Vector3.hpp"
|
||||
|
||||
using MathEngine::iVector3;
|
||||
using MathEngine::Vector3;
|
||||
|
||||
iVector3::iVector3( const int X /*= 0*/, const int Y /*= 0*/, const int Z /*= 0*/ )
|
||||
: iVector2(X, Y), z(Z)
|
||||
{}
|
||||
|
||||
iVector3::iVector3( const iVector2& copy )
|
||||
: iVector2(copy), z(0)
|
||||
{}
|
||||
|
||||
iVector3::iVector3( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.w);
|
||||
}
|
||||
|
||||
iVector3& iVector3::operator=( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.w);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector3::operator==( const SDL_Rect& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
if ( y == other.y )
|
||||
if ( z == other.w )
|
||||
rtn = true;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
iVector3::iVector3( const Vector3& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.z);
|
||||
}
|
||||
|
||||
iVector3& iVector3::operator=( const Vector3& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.z);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector3::operator==( const iVector3& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
if ( y == other.y )
|
||||
if ( z == other.z )
|
||||
rtn = true;
|
||||
return rtn;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef _IVECTOR3_HPP_
|
||||
#define _IVECTOR3_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
/*** Custom Header File ***/
|
||||
#include "iVector2.hpp"
|
||||
|
||||
namespace MathEngine {
|
||||
struct Vector3;
|
||||
|
||||
struct EXPORT_FROM_MYDLL iVector3 : public iVector2
|
||||
{
|
||||
iVector3( const int X = 0, const int Y = 0, const int Z = 0);
|
||||
|
||||
iVector3( const iVector2& copy );
|
||||
|
||||
iVector3( const SDL_Rect& copy );
|
||||
|
||||
iVector3& operator=( const SDL_Rect& copy );
|
||||
|
||||
bool operator==( const SDL_Rect& other ) const;
|
||||
|
||||
iVector3( const Vector3& copy );
|
||||
|
||||
iVector3& operator=( const Vector3& copy );
|
||||
|
||||
bool operator==( const iVector3& other ) const;
|
||||
|
||||
int z;
|
||||
};/// END STRUCT DEFINITION iVector3
|
||||
}/// END NAMESPACE DEFINITION MathEngine
|
||||
#endif/// END IFNDEF _IVECTOR3_HPP_
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "iVector4.hpp"
|
||||
|
||||
/*** Custom Header File ***/
|
||||
#include "../Vector/Vector4.hpp"
|
||||
|
||||
using MathEngine::iVector4;
|
||||
using MathEngine::Vector4;
|
||||
|
||||
iVector4::iVector4( const int X /*= 0*/, const int Y /*= 0*/, const int Z /*= 0*/, const int W /*= 0*/ )
|
||||
: iVector3(X, Y, Z), w(W)
|
||||
{}
|
||||
|
||||
iVector4::iVector4( const iVector2& copy )
|
||||
: iVector3(copy.x, copy.y, 0), w(0)
|
||||
{}
|
||||
|
||||
iVector4::iVector4( const iVector3& copy )
|
||||
: iVector3(copy), w(0)
|
||||
{}
|
||||
|
||||
iVector4::iVector4( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.w);
|
||||
w = int(copy.h);
|
||||
}
|
||||
|
||||
iVector4& iVector4::operator=( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.w);
|
||||
w = int(copy.h);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector4::operator==( const SDL_Rect& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
if ( y == other.y )
|
||||
if ( z == other.w )
|
||||
if ( w == other.h )
|
||||
rtn = true;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
iVector4::iVector4( const Vector4& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.z);
|
||||
w = int(copy.w);
|
||||
}
|
||||
|
||||
iVector4& iVector4::operator=( const Vector4& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
z = int(copy.z);
|
||||
w = int(copy.w);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector4::operator==( const iVector4& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
if ( y == other.y )
|
||||
if ( z == other.z )
|
||||
if ( w == other.w )
|
||||
rtn = true;
|
||||
return rtn;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef _IVECTOR4_HPP_
|
||||
#define _IVECTOR4_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
/*** Custom Header File ***/
|
||||
#include "iVector3.hpp"
|
||||
|
||||
namespace MathEngine {
|
||||
struct Vector4;
|
||||
|
||||
struct EXPORT_FROM_MYDLL iVector4 : public iVector3
|
||||
{
|
||||
iVector4( const int X = 0, const int Y = 0, const int Z = 0, const int W = 0 );
|
||||
|
||||
iVector4( const iVector2& copy );
|
||||
|
||||
iVector4( const iVector3& copy );
|
||||
|
||||
iVector4( const SDL_Rect& copy );
|
||||
|
||||
iVector4& operator=( const SDL_Rect& copy );
|
||||
|
||||
bool operator==( const SDL_Rect& other ) const;
|
||||
|
||||
iVector4( const Vector4& copy );
|
||||
|
||||
iVector4& operator=( const Vector4& copy );
|
||||
|
||||
bool operator==( const iVector4& other ) const;
|
||||
|
||||
int w;
|
||||
};/// END STRUCT DEFINITION iVector4
|
||||
}/// END NAMESPACE DEFINITION MathEngine
|
||||
#endif/// END IFNDEF _IVECTOR4_HPP_
|
||||
Reference in New Issue
Block a user