mirror of https://github.com/AxioDL/zeus.git
Add clip-space constructor for CVector4f
This commit is contained in:
parent
8a062453ef
commit
1347e23597
|
@ -117,6 +117,13 @@ public:
|
|||
return xfVec.toVec3f() / xfVec.w;
|
||||
}
|
||||
|
||||
inline CVector3f multiplyOneOverW(const CVector3f& point, float& wOut) const
|
||||
{
|
||||
CVector4f xfVec = *this * point;
|
||||
wOut = xfVec.w;
|
||||
return xfVec.toVec3f() / xfVec.w;
|
||||
}
|
||||
|
||||
union {
|
||||
float m[4][4];
|
||||
struct
|
||||
|
|
|
@ -89,6 +89,13 @@ public:
|
|||
w = 1.0f;
|
||||
}
|
||||
|
||||
static CVector4f ToClip(const zeus::CVector3f& v, float w)
|
||||
{
|
||||
CVector4f ret(v * w);
|
||||
ret.w = w;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline CVector3f toVec3f() const
|
||||
{
|
||||
#if __SSE__
|
||||
|
|
Loading…
Reference in New Issue