mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-19 14:43:47 +00:00
some enchancements for shadowmapping
new /= operator in point4f _calcClipSpaceAABB in pssm no longer uses radius just transform points into light space and do min max _roundProjection matrix also optimized.
This commit is contained in:
parent
03a348deb7
commit
80bd8f8117
3 changed files with 66 additions and 63 deletions
|
|
@ -104,6 +104,7 @@ class Point4F
|
|||
Point4F& operator*=(const Point4F&);
|
||||
Point4F& operator=(const Point3F&);
|
||||
Point4F& operator=(const Point4F&);
|
||||
Point4F& operator/=(F32);
|
||||
|
||||
Point3F asPoint3F() const { return Point3F(x,y,z); }
|
||||
|
||||
|
|
@ -186,6 +187,20 @@ inline Point4F& Point4F::operator=(const Point4F &_vec)
|
|||
return *this;
|
||||
}
|
||||
|
||||
inline Point4F& Point4F::operator/=(F32 scalar)
|
||||
{
|
||||
// Prevent division by zero
|
||||
if (mIsZero(scalar))
|
||||
return *this;
|
||||
|
||||
x /= scalar;
|
||||
y /= scalar;
|
||||
z /= scalar;
|
||||
w /= scalar;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Point4F Point4F::operator+(const Point4F& _add) const
|
||||
{
|
||||
return Point4F( x + _add.x, y + _add.y, z + _add.z, w + _add.w );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue