#include "dxstdafx.h" #include ".\plane.h" Plane::Plane(void) { } Plane::~Plane(void) { } void Plane::setPoint(Vector p) { this->point = p; } void Plane::setPoint(float _x, float _y, float _z) { this->point.x = _x; this->point.y = _y; this->point.z = _z; } Vector Plane::getPoint() { return this->point; } void Plane::setNormal(Vector &n) { this->normal = n; this->normal.normalize(); } void Plane::setNormal(float _nx, float _ny, float _nz) { this->normal.x = _nx; this->normal.y = _ny; this->normal.z = _nz; this->normal.normalize(); } Vector Plane::getNormal() { return this->normal; } bool Plane::inFront(Vector p) { Vector diff; diff = p - this->point; diff.normalize(); float cosa = diff.dotProd(this->normal); if(cosa>=0) return true; return false; } bool Plane::inFront(float x, float y, float z) { Vector p; p.x = x; p.y = y; p.z = z; return this->inFront(p); }