Supermodel/Src/Graphics/New3D/Plane.h

23 lines
338 B
C
Raw Normal View History

#ifndef _PLANE_H_
#define _PLANE_H_
#include <cmath>
struct Plane
{
float a, b, c, d;
void Normalise() {
float temp = std::sqrt((a * a) + (b * b) + (c * c));
a /= temp;
b /= temp;
c /= temp;
d /= temp;
}
float DistanceToPoint(const float v[3]) {
return a*v[0] + b*v[1] + c*v[2] + d;
}
};
#endif