simpler plane3_translated()

This commit is contained in:
Garux
2025-11-16 22:57:32 +05:00
parent 52a84481bf
commit a04eae5054
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -75,9 +75,9 @@ inline Plane3 plane3_normalised( const Plane3& plane ){
);
}
template<typename T>
Plane3 plane3_translated( const Plane3& plane, const BasicVector3<T>& translation ){
return Plane3( plane.normal(), vector3_dot( plane.normal(), plane.normal() * plane.dist() + translation ) );
template<typename P, typename V>
Plane3___<P> plane3_translated( const Plane3___<P>& plane, const BasicVector3<V>& translation ){
return Plane3___<P>( plane.normal(), plane.dist() + vector3_dot( plane.normal(), translation ) );
}
inline Plane3 plane3_transformed( const Plane3& plane, const Matrix4& transform ){
+1 -1
View File
@@ -645,7 +645,7 @@ int ShiftBSPMain( Args& args ){
/* shift planes */
for ( bspPlane_t& plane : bspPlanes )
{
plane.dist() = vector3_dot( plane.normal(), plane.normal() * plane.dist() + shift );
plane = plane3_translated( plane, shift );
}
// fixme: engine says 'light grid mismatch', unless translation is multiple of grid size