mirror of
https://github.com/AxioDL/zeus.git
synced 2025-07-14 17:15:58 +00:00
Some cleanup
This commit is contained in:
parent
68612ccd4c
commit
505696e4a3
@ -16,9 +16,7 @@ public:
|
|||||||
CPlane(float a, float b, float c, float d) : a(a), b(b), c(c), d(d) {}
|
CPlane(float a, float b, float c, float d) : a(a), b(b), c(c), d(d) {}
|
||||||
CPlane(const CVector3f& a, const CVector3f& b, const CVector3f& c)
|
CPlane(const CVector3f& a, const CVector3f& b, const CVector3f& c)
|
||||||
{
|
{
|
||||||
CVector3f ab = b - a;
|
vec = (b - a).cross(c - a).normalized();
|
||||||
CVector3f ac = c - a;
|
|
||||||
vec = ab.cross(ac).normalized();
|
|
||||||
d = -a.dot(vec);
|
d = -a.dot(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +34,7 @@ public:
|
|||||||
|
|
||||||
float clipLineSegment(const CVector3f& a, const CVector3f& b)
|
float clipLineSegment(const CVector3f& a, const CVector3f& b)
|
||||||
{
|
{
|
||||||
float mag = ((b.z - a.z) * (((b.x - a.x) * ((b.y - a.y) * vec.y)) + vec.x)) + vec.z;
|
float mag = (b-a).dot(vec);
|
||||||
float dis = (-(vec.y - d)) / mag;
|
float dis = (-(vec.y - d)) / mag;
|
||||||
return clamp(0.0f, dis, 1.0f);
|
return clamp(0.0f, dis, 1.0f);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ CColor& CColor::operator=(const CVector4f& other)
|
|||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CColor::fromHSV(float h, float s, float v, float _a)
|
void CColor::fromHSV(float h, float s, float v, float _a)
|
||||||
{
|
{
|
||||||
int i = int(h * 6);
|
int i = int(h * 6);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user