Files
Work/engine/RECT3D.HPP
2024-08-07 09:16:27 -04:00

90 lines
1.6 KiB
C++

#ifndef _ENGINE_RECT3D_HPP_
#define _ENGINE_RECT3D_HPP_
#ifndef _ENGINE_VECTOR3D_HPP_
#include <engine/vector3d.hpp>
#endif
class Rect3D
{
public:
Rect3D(void);
Rect3D(const Rect3D &someRect3D);
Rect3D(const Vector3D &firstPlane,int depth);
virtual ~Rect3D();
Rect3D &operator=(const Rect3D &someRect3D);
WORD operator==(const Rect3D &someRect3D)const;
const Vector3D &firstPlane(void)const;
void firstPlane(const Vector3D &firstPlane);
const Vector3D &nextPlane(void)const;
void nextPlane(const Vector3D &nextPlane);
private:
Vector3D mFirstPlane;
Vector3D mNextPlane;
};
inline
Rect3D::Rect3D(void)
{
}
inline
Rect3D::Rect3D(const Rect3D &someRect3D)
{
*this=someRect3D;
}
inline
Rect3D::Rect3D(const Vector3D &firstPlane,int depth)
: mFirstPlane(firstPlane)
{
mNextPlane=mFirstPlane;
mNextPlane[0].z(mFirstPlane[0].z()+depth);
mNextPlane[1].z(mFirstPlane[1].z()+depth);
mNextPlane[2].z(mFirstPlane[2].z()+depth);
mNextPlane[3].z(mFirstPlane[3].z()+depth);
}
inline
Rect3D::~Rect3D()
{
}
inline
Rect3D &Rect3D::operator=(const Rect3D &someRect3D)
{
firstPlane(someRect3D.firstPlane());
nextPlane(someRect3D.nextPlane());
return *this;
}
inline
WORD Rect3D::operator==(const Rect3D &someRect3D)const
{
return (firstPlane()==someRect3D.firstPlane()&&
nextPlane()==someRect3D.nextPlane());
}
inline
const Vector3D &Rect3D::firstPlane(void)const
{
return mFirstPlane;
}
inline
void Rect3D::firstPlane(const Vector3D &firstPlane)
{
mFirstPlane=firstPlane;
}
inline
const Vector3D &Rect3D::nextPlane(void)const
{
return mNextPlane;
}
inline
void Rect3D::nextPlane(const Vector3D &nextPlane)
{
mNextPlane=nextPlane;
}
#endif