mirror of
https://github.com/halpz/re3.git
synced 2025-07-22 10:39:47 +00:00
implemented some higher level functions; added lots of stubs; switched top and bottom in CRect
This commit is contained in:
@ -1,31 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#pragma once
|
||||
|
||||
class CRect
|
||||
{
|
||||
public:
|
||||
float left; // x min
|
||||
float top; // y max
|
||||
float bottom; // y max
|
||||
float right; // x max
|
||||
float bottom; // y min
|
||||
float top; // y min
|
||||
|
||||
CRect(void){
|
||||
left = 1000000.0f;
|
||||
bottom = 1000000.0f;
|
||||
top = 1000000.0f;
|
||||
right = -1000000.0f;
|
||||
top = -1000000.0f;
|
||||
bottom = -1000000.0f;
|
||||
}
|
||||
CRect(float l, float b, float r, float t){
|
||||
CRect(float l, float t, float r, float b){
|
||||
left = l;
|
||||
bottom = b;
|
||||
right = r;
|
||||
top = t;
|
||||
right = r;
|
||||
bottom = b;
|
||||
}
|
||||
void ContainPoint(CVector const &v){
|
||||
if(v.x < left) left = v.x;
|
||||
if(v.x > right) right = v.x;
|
||||
if(v.y < bottom) bottom = v.y;
|
||||
if(v.y > top) top = v.y;
|
||||
if(v.y < top) top = v.y;
|
||||
if(v.y > bottom) bottom = v.y;
|
||||
}
|
||||
};
|
||||
|
@ -101,6 +101,11 @@ inline CVector operator*(const CVector &left, float right)
|
||||
return CVector(left.x * right, left.y * right, left.z * right);
|
||||
}
|
||||
|
||||
inline CVector operator*(float left, const CVector &right)
|
||||
{
|
||||
return CVector(left * right.x, left * right.y, left * right.z);
|
||||
}
|
||||
|
||||
inline CVector operator/(const CVector &left, float right)
|
||||
{
|
||||
return CVector(left.x / right, left.y / right, left.z / right);
|
||||
|
Reference in New Issue
Block a user