summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/typedefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/typedefs.h')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/typedefs.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/typedefs.h b/MatchBloxEngine/MatchBloxEngine/typedefs.h
index 0b9190c..7acb776 100644
--- a/MatchBloxEngine/MatchBloxEngine/typedefs.h
+++ b/MatchBloxEngine/MatchBloxEngine/typedefs.h
@@ -29,13 +29,13 @@ typedef struct vec3d
inline vec3d& operator*=(const double &scal)
{ x*=scal; y*=scal; z*=scal; return *this; }
- inline const vec3d& operator+(const vec3d &rhs)
+ inline const vec3d& operator+(const vec3d &rhs) const
{ return vec3d(*this) += rhs; }
- inline const vec3d& operator-(const vec3d &rhs)
+ inline const vec3d& operator-(const vec3d &rhs) const
{ return vec3d(*this) -= rhs; }
- inline const vec3d& operator*(const vec3d &rhs)
+ inline const vec3d& operator*(const vec3d &rhs) const
{ return vec3d(*this) *= rhs; }
- inline const vec3d& operator*(const double &scal)
+ inline const vec3d& operator*(const double &scal) const
{ return vec3d(*this) *= scal; }
} Vect3D_t;
@@ -59,7 +59,7 @@ typedef struct bb
//translating a bounding box
inline bb& operator+=(const Vect3D_t &v)
{ m_Min += v; m_Max += v; return *this; }
- inline const bb& operator+(const Vect3D_t &v)
+ inline const bb& operator+(const Vect3D_t &v) const
{ return (bb(*this) += v); }
//update the bounding box min/max coords with vertex v
@@ -74,7 +74,7 @@ typedef struct bb
return *this;
}
- inline bool Contains(const Vect3D_t &v)
+ inline bool Contains(const Vect3D_t &v) const
{
//check if the point is contained in the box
return m_Min.x < v.x && v.x < m_Max.x &&
@@ -82,12 +82,12 @@ typedef struct bb
m_Min.z < v.z && v.z < m_Max.z;
}
- inline bool Contains(const bb& b)
+ inline bool Contains(const bb& b) const
{
return Contains(b.m_Min) && Contains(b.m_Max);
}
- inline bool Overlap(const bb& rhs)
+ inline bool Overlap(const bb& rhs) const
{
//check if the boxes overlap in all three axis
return ( ( m_Min.x < rhs.m_Min.x && rhs.m_Min.x < rhs.m_Max.x) ||