/
redgpu
/
GDMagArchive
Обзор
Документация
Войти
/
redgpu
/
GDMagArchive
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
aug00/sharp/math/Plane.cpp
35 строк
833 B
Don Williamson
first commit
31 окт 2016, 17:03
31 окт 2016, 17:03
c823e7b
Код
Авторство
О чём код?
#include <math/Plane.h> #include <math.h> Plane::Plane(const Vector& normal, float offset) { // We store the normal normalized. abc = normal; d = offset / abc.getMagnitude(); abc.normalize(); } const Vector& Plane::getNormal() const { return abc; } float Plane::getA() const { return abc.x; } float Plane::getB() const { return abc.y; } float Plane::getC() const { return abc.z; } float Plane::getD() const { return d; } void Plane::setA(float newVal) { abc.x = newVal; } void Plane::setB(float newVal) { abc.y = newVal; } void Plane::setC(float newVal) { abc.z = newVal; } void Plane::setD(float newVal) { d = newVal; } bool Plane::isInside(const Vector& test) const { float planeEqVal = abc.x*test.x + abc.y*test.y + abc.z*test.z + d; if (planeEqVal > 0) { return true; } else { return false; } }