Mathematical module. More...
#include <windows.h>
#include <d3dx9.h>
Go to the source code of this file.
Classes | |
struct | common::POINT_ |
Punkt 2D z liczb całkowitych. More... | |
struct | common::VEC2 |
Wektor floatów 2D. More... | |
struct | common::VEC3 |
Wektor floatów 3D. More... | |
struct | common::VEC4 |
Wektor floatów 4D. More... | |
struct | common::RECTI |
Prostokąt z liczb całkowitych. More... | |
struct | common::RECTF |
Prostokąt z 4 floatów. More... | |
struct | common::BOX |
AABB z 2 punktów 3D. More... | |
struct | common::OBB |
OBB - Oriented Bounding Box - prostopadłościan o dowolnej orientacji. More... | |
struct | common::RECT3D |
Płaski prostokąt, dowolnie zorientowany w przestrzeni 3D. More... | |
struct | common::COLOR |
Kolor w formacie A8R8G8B8. More... | |
struct | common::COLORF |
Kolor z 4 liczb typu float - R, G, B, A. More... | |
struct | common::PLANE |
Płaszczyzna. More... | |
struct | common::LINE2D |
Prosta 2D. More... | |
struct | common::MATRIX |
Macierz 4 x 4. More... | |
struct | common::MATRIX33 |
Macierz 3 x 3. More... | |
struct | common::QUATERNION |
Kwaternion. More... | |
struct | common::AFFINE2D |
Affine transform of 2D point/vector. More... | |
struct | common::FRUSTUM_PLANES |
Frustum opisany 6 płaszczyznami z wektorami normalnymi zwróconymi do wewnątrz. More... | |
struct | common::FRUSTUM_POINTS |
Frustum zapisany jako 8 wierzchołków. More... | |
class | common::FRUSTUM_RADAR |
Frustum - reprezentacja radarowa. More... | |
class | common::SmoothCD_obj< T > |
class | common::CubicBezierCurveIntegral< T > |
class | common::RayToTriangleCalc |
Klasa, która dzięki pamiętaniu wyników pośrednich przyspiesza testowanie kolizji jednego trójkąta z wieloma promieniami. More... | |
struct | SthToStr_obj< common::POINT_ > |
struct | StrToSth_obj< common::POINT_ > |
struct | SthToStr_obj< common::VEC2 > |
struct | StrToSth_obj< common::VEC2 > |
struct | SthToStr_obj< common::VEC3 > |
struct | StrToSth_obj< common::VEC3 > |
struct | SthToStr_obj< common::VEC4 > |
struct | StrToSth_obj< common::VEC4 > |
struct | SthToStr_obj< common::RECTI > |
struct | StrToSth_obj< common::RECTI > |
struct | SthToStr_obj< common::RECTF > |
struct | StrToSth_obj< common::RECTF > |
struct | SthToStr_obj< common::BOX > |
struct | StrToSth_obj< common::BOX > |
struct | SthToStr_obj< common::COLOR > |
struct | StrToSth_obj< common::COLOR > |
struct | SthToStr_obj< common::COLORF > |
struct | StrToSth_obj< common::COLORF > |
struct | SthToStr_obj< common::PLANE > |
struct | StrToSth_obj< common::PLANE > |
struct | SthToStr_obj< common::LINE2D > |
struct | StrToSth_obj< common::LINE2D > |
struct | SthToStr_obj< common::MATRIX > |
struct | StrToSth_obj< common::MATRIX > |
struct | SthToStr_obj< common::QUATERNION > |
struct | StrToSth_obj< common::QUATERNION > |
struct | SthToStr_obj< common::AFFINE2D > |
struct | StrToSth_obj< common::AFFINE2D > |
Namespaces | |
namespace | common |
Główna przestrzeń nazw biblioteki CommonLib. | |
Defines | |
#define | VEC2_SWIZZLE(v, c0, c1) (common::VEC2((v).c0, (v).c1)) |
#define | VEC3_SWIZZLE(v, c0, c1, c2) (common::VEC3((v).c0, (v).c1, (v).c2)) |
#define | VEC4_SWIZZLE(v, c0, c1, c2, c3) (common::VEC4((v).c0, (v).c1, (v).c2, (v).c3)) |
Functions | |
template<typename DestT , typename SrcT > | |
DestT & | common::math_cast (const SrcT &x) |
Szablon bazowy do konwersji między typami matematycznymi. | |
POINT_ | common::operator* (const POINT_ pt, int v) |
POINT_ | common::operator/ (const POINT_ pt, int v) |
POINT_ | common::operator* (int v, const POINT_ pt) |
POINT_ | common::operator/ (int v, const POINT_ pt) |
template<> | |
::POINT & | common::math_cast<::POINT, POINT_ > (const POINT_ &x) |
Konwersja z common::POINT_ do POINT. | |
template<> | |
POINT_ & | common::math_cast< POINT_,::POINT > (const ::POINT &x) |
Konwersja z POINT do common::POINT_. | |
void | common::swap (POINT_ &v1, POINT_ &v2) |
void | common::Mul (POINT_ *out, const POINT_ &p1, const POINT_ &p2) |
void | common::Div (POINT_ *out, const POINT_ &p1, const POINT_ &p2) |
void | common::Mul (POINT_ *inout, const POINT_ &v) |
void | common::Div (POINT_ *inout, const POINT_ &v) |
void | common::Min (common::POINT_ *out, const common::POINT_ &a, const common::POINT_ &b) |
void | common::Max (common::POINT_ *out, const common::POINT_ &a, const common::POINT_ &b) |
VEC2 | common::operator* (const VEC2 pt, float v) |
VEC2 | common::operator/ (const VEC2 pt, float v) |
VEC2 | common::operator* (float v, const VEC2 pt) |
void | common::swap (VEC2 &v1, VEC2 &v2) |
VEC3 | common::operator* (const VEC3 pt, float v) |
VEC3 | common::operator/ (const VEC3 pt, float v) |
VEC3 | common::operator* (float v, const VEC3 pt) |
void | common::swap (VEC3 &v1, VEC3 &v2) |
VEC4 | common::operator* (const VEC4 pt, float v) |
VEC4 | common::operator/ (const VEC4 pt, float v) |
VEC4 | common::operator* (float v, const VEC4 pt) |
void | common::swap (VEC4 &v1, VEC4 &v2) |
float | common::LengthSq (const VEC2 &v) |
Zwraca kwadrat długości wektora. | |
float | common::LengthSq (const VEC3 &v) |
float | common::LengthSq (const VEC4 &v) |
float | common::Length (const VEC2 &v) |
Zwraca długość wektora. | |
float | common::Length (const VEC3 &v) |
float | common::Length (const VEC4 &v) |
float | common::ManhattanLength (const VEC2 &v) |
float | common::ManhattanLength (const VEC3 &v) |
float | common::ManhattanLength (const VEC4 &v) |
float | common::MaxLength (const VEC2 &v) |
float | common::MaxLength (const VEC3 &v) |
float | common::MaxLength (const VEC4 &v) |
void | common::Min (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
Zwraca wektor złożony z mniejszych składowych podanych wektorów. | |
void | common::Min (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Min (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::Max (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
Zwraca wektor złożony z większych składowych podanych wektorów. | |
void | common::Max (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Max (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::saturate (VEC2 &v) |
void | common::saturate (VEC3 &v) |
void | common::saturate (VEC4 &v) |
void | common::Mul (VEC2 *Out, const VEC2 &v, float f) |
void | common::Mul (VEC3 *Out, const VEC3 &v, float f) |
void | common::Mul (VEC4 *Out, const VEC4 &v, float f) |
void | common::Add (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
void | common::Add (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Add (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::Sub (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
void | common::Sub (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Sub (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::Mul (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
void | common::Mul (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Mul (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::Div (VEC2 *Out, const VEC2 &v1, const VEC2 &v2) |
void | common::Div (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
void | common::Div (VEC4 *Out, const VEC4 &v1, const VEC4 &v2) |
void | common::Mul (VEC2 *inout, const VEC2 &v) |
void | common::Mul (VEC3 *inout, const VEC3 &v) |
void | common::Mul (VEC4 *inout, const VEC4 &v) |
void | common::Div (VEC2 *inout, const VEC2 &v) |
void | common::Div (VEC3 *inout, const VEC3 &v) |
void | common::Div (VEC4 *inout, const VEC4 &v) |
void | common::Abs (VEC2 *v) |
void | common::Abs (VEC3 *v) |
void | common::Abs (VEC4 *v) |
float | common::Dot (const VEC2 &v1, const VEC2 &v2) |
Iloczyn skalarny wektorów. | |
float | common::Dot (const VEC3 &v1, const VEC3 &v2) |
float | common::Dot (const VEC4 &v1, const VEC4 &v2) |
void | common::Minus (VEC2 *Out, VEC2 &v) |
Odwraca znak składowych wektora. | |
void | common::Minus (VEC3 *Out, VEC3 &v) |
void | common::Minus (VEC4 *Out, VEC4 &v) |
void | common::Minus (VEC2 *InOut) |
void | common::Minus (VEC3 *InOut) |
void | common::Minus (VEC4 *InOut) |
float | common::Cross (const VEC2 &v1, const VEC2 &v2) |
Iloczyn wektorowy dwóch wektorów dający liczbę mówiącą czy drugi wskazuje na lewo, czy na prawo względem pierwszego. | |
void | common::Cross (VEC3 *Out, const VEC3 &v1, const VEC3 &v2) |
Iloczyn wektorowy dwóch wektorów 3D. | |
float | common::DistanceSq (const VEC2 &p1, const VEC2 &p2) |
Kwadrat odległości między dwoma punktami. | |
float | common::DistanceSq (const VEC3 &p1, const VEC3 &p2) |
float | common::DistanceSq (const VEC4 &p1, const VEC4 &p2) |
float | common::Distance (const VEC2 &p1, const VEC2 &p2) |
Odległość między dwoma punktami. | |
float | common::Distance (const VEC3 &p1, const VEC3 &p2) |
float | common::Distance (const VEC4 &p1, const VEC4 &p2) |
float | common::ManhattanDistance (const VEC2 &p1, const VEC2 &p2) |
float | common::ManhattanDistance (const VEC3 &p1, const VEC3 &p2) |
float | common::ManhattanDistance (const VEC4 &p1, const VEC4 &p2) |
float | common::MaxDistance (const VEC2 &p1, const VEC2 &p2) |
float | common::MaxDistance (const VEC3 &p1, const VEC3 &p2) |
float | common::MaxDistance (const VEC4 &p1, const VEC4 &p2) |
void | common::Lerp (VEC2 *Out, const VEC2 &v1, const VEC2 &v2, float t) |
Liniowa interpolacja wektorów. | |
void | common::Lerp (VEC3 *Out, const VEC3 &v1, const VEC3 &v2, float t) |
void | common::Lerp (VEC4 *Out, const VEC4 &v1, const VEC4 &v2, float t) |
void | common::Normalize (VEC2 *Out, const VEC2 &v) |
Normalizuje wektor, czyli zmienia mu długość na 1. | |
void | common::Normalize (VEC3 *Out, const VEC3 &v) |
void | common::Normalize (VEC4 *Out, const VEC4 &v) |
void | common::Normalize (VEC2 *v) |
Normalizuje wektor w miejscu. | |
void | common::Normalize (VEC3 *v) |
void | common::Normalize (VEC4 *v) |
bool | common::SafeNormalize (VEC2 *v) |
Bezpieczna normalizacja wektora w miejscu. W przypadku wektora zerowego zwraca false. | |
bool | common::SafeNormalize (VEC3 *v) |
bool | common::SafeNormalize (VEC4 *v) |
void | common::Vec3ToVec4 (VEC4 *Out, const VEC3 &v) |
Konwersja z wektora 3D na 4D dopisująca W=1. | |
void | common::Vec4ToVec3_Ignore (VEC3 *Out, const VEC4 &v) |
Konwersja z wektora 4D na 3D ze zignorowaniem składowej W. | |
void | common::Vec4ToVec3_Div (VEC3 *Out, const VEC4 &v) |
Konwersja z wektora 4D na 3D ze podzieleniem składowych przez W. | |
void | common::MidPoint (VEC2 *Out, const VEC2 &p1, const VEC2 &p2) |
Zwraca punkt w połowie drogi między podanymi punktami. | |
void | common::MidPoint (VEC3 *Out, const VEC3 &p1, const VEC3 &p2) |
void | common::MidPoint (VEC4 *Out, const VEC4 &p1, const VEC4 &p2) |
bool | common::VecEqual (const VEC2 &v1, const VEC2 &v2) |
Zwraca true, jeśli podane wektory/punkty są sobie mniej więcej równe. | |
bool | common::VecEqual (const VEC3 &v1, const VEC3 &v2) |
bool | common::VecEqual (const VEC4 &v1, const VEC4 &v2) |
bool | common::Less (const VEC2 &v1, const VEC2 &v2) |
bool | common::Less (const VEC3 &v1, const VEC3 &v2) |
bool | common::Less (const VEC4 &v1, const VEC4 &v2) |
bool | common::LessOrEqual (const VEC2 &v1, const VEC2 &v2) |
bool | common::LessOrEqual (const VEC3 &v1, const VEC3 &v2) |
bool | common::LessOrEqual (const VEC4 &v1, const VEC4 &v2) |
bool | common::Greater (const VEC2 &v1, const VEC2 &v2) |
bool | common::Greater (const VEC3 &v1, const VEC3 &v2) |
bool | common::Greater (const VEC4 &v1, const VEC4 &v2) |
bool | common::GreaterOrEqual (const VEC2 &v1, const VEC2 &v2) |
bool | common::GreaterOrEqual (const VEC3 &v1, const VEC3 &v2) |
bool | common::GreaterOrEqual (const VEC4 &v1, const VEC4 &v2) |
bool | common::around (const VEC2 &v1, const VEC2 &v2, float Epsilon) |
bool | common::around (const VEC3 &v1, const VEC3 &v2, float Epsilon) |
bool | common::around (const VEC4 &v1, const VEC4 &v2, float Epsilon) |
void | common::Perpedicular (VEC2 *Out, const VEC2 &v) |
Zwraca wektor prostopadły do podanego wektora 2D. | |
void | common::Reflect (VEC2 *Out, const VEC2 &v, const VEC2 &PlaneNormal) |
Oblicza wektor kierunku odbicia od płaszczyzny o podanej normalnej. | |
void | common::Reflect (VEC3 *Out, const VEC3 &v, const VEC3 &PlaneNormal) |
void | common::Refract (VEC2 *out, const VEC2 &I, const VEC2 &N, float eta) |
For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. | |
void | common::Refract (VEC3 *out, const VEC3 &I, const VEC3 &N, float eta) |
void | common::Project (VEC2 *Out, const VEC2 &V, const VEC2 &N) |
Rzutowanie wektora V na wektor N. | |
void | common::Project (VEC3 *Out, const VEC3 &V, const VEC3 &N) |
void | common::Project_N (VEC2 *Out, const VEC2 &V, const VEC2 &N) |
Wersja common::Project, kiedy wektor N jest już na pewno znormalizowany. | |
void | common::Project_N (VEC3 *Out, const VEC3 &V, const VEC3 &N) |
float | common::ScalarTripleProduct (const VEC3 &u, const VEC3 &v, const VEC3 &w) |
Oblicza: u cross v dot w. | |
void | common::Orthogonalize_Fast (VEC3 *OutR1, VEC3 *OutR2, VEC3 *OutR3, const VEC3 &R1, const VEC3 &R2, const VEC3 &R3) |
Ortogonalizacja trzech wektorów - Metoda szybka. | |
void | common::Orthogonalize (VEC3 *OutR1, VEC3 *OutR2, VEC3 *OutR3, const VEC3 &R1, const VEC3 &R2, const VEC3 &R3) |
Ortogonalizacja trzech wektorów - Metoda dokładna. | |
void | common::PerpedicularVectors (VEC3 *Out1, VEC3 *Out2, const VEC3 &v) |
Wyznacza dwa dowolne wektory prostopadłe do podanego. | |
float | common::TriangleArea (const VEC2 &p1, const VEC2 &p2, const VEC2 &p3) |
Oblicza signed pole powierzchni trójkąta. | |
float | common::TriangleArea (const VEC3 &p1, const VEC3 &p2, const VEC3 &p3) |
bool | common::TriangleIsCW (const VEC2 &p1, const VEC2 &p2, const VEC2 &p3) |
Zwraca true, jeśli wierzchołki trójkąta są CW. | |
float | common::TrianglePerimeter (const VEC2 &p1, const VEC2 &p2, const VEC2 &p3) |
Znajduje obwód trójkąta. | |
float | common::TrianglePerimeter (const VEC3 &p1, const VEC3 &p2, const VEC3 &p3) |
void | common::Barycentric (VEC2 *Out, const VEC2 &p1, const VEC2 &p2, const VEC2 &p3, float f, float g) |
Oblicza punkt na powierzhchni trójkąta we wsp. barycentrycznych. | |
void | common::Barycentric (VEC3 *Out, const VEC3 &p1, const VEC3 &p2, const VEC3 &p3, float f, float g) |
void | common::Barycentric (VEC4 *Out, const VEC4 &p1, const VEC4 &p2, const VEC4 &p3, float f, float g) |
void | common::CalcBarycentric (const VEC2 &p, const VEC2 &p1, const VEC2 &p2, const VEC2 &p3, float *out_e, float *out_f, float *out_g) |
Współrzędne barycentryczne punktu p względem trójkąta p1-p2-p3. | |
void | common::CalcBarycentric (const VEC3 &p, const VEC3 &p1, const VEC3 &p2, const VEC3 &p3, const VEC3 *Normal, float *out_e, float *out_f, float *out_g) |
Współrzędne barycentryczne punktu p względem trójkąta p1-p2-p3. | |
void | common::TriangleInscribedCircle (VEC2 *OutCenter, float *OutRadius, const VEC2 &v1, const VEC2 &v2, const VEC2 &v3) |
Znajduje okrąg wpisany w trójkąt. | |
void | common::TriangleInscribedCircle (VEC3 *OutCenter, float *OutRadius, const VEC3 &v1, const VEC3 &v2, const VEC3 &v3) |
void | common::TriangleCircumscribedCircle (VEC2 *OutCenter, float *OutRadius, const VEC2 &v1, const VEC2 &v2, const VEC2 &v3) |
Znajduje okrąg opisany na trójkącie. | |
void | common::TriangleCircumscribedCircle (VEC3 *OutCenter, float *OutRadius, const VEC3 &v1, const VEC3 &v2, const VEC3 &v3) |
void | common::PointOnRay (VEC2 *Out, const VEC2 &Origin, const VEC2 &Direction, float t) |
Zwraca punkt na promieniu. | |
void | common::PointOnRay (VEC3 *Out, const VEC3 &Origin, const VEC3 &Direction, float t) |
template<> | |
::RECT & | common::math_cast<::RECT, RECTI > (const RECTI &x) |
Konwersja z common::RECTI do RECT z WinAPI. | |
template<> | |
RECTI & | common::math_cast< RECTI,::RECT > (const ::RECT &x) |
Konwersja z RECT z WinAPI do common::RECTI. | |
void | common::swap (RECTI &r1, RECTI &r2) |
void | common::swap (RECTF &r1, RECTF &r2) |
void | common::Mul (RECTI *out, const RECTI &rect, const POINT_ &v) |
void | common::Mul (RECTF *out, const RECTF &rect, const VEC2 &v) |
void | common::Div (RECTI *out, const RECTI &rect, const POINT_ &v) |
void | common::Div (RECTF *out, const RECTF &rect, const VEC2 &v) |
void | common::Mul (RECTI *inout, const POINT_ &v) |
void | common::Mul (RECTF *inout, const VEC2 &v) |
void | common::Div (RECTI *inout, const POINT_ &v) |
void | common::Div (RECTF *inout, const VEC2 &v) |
bool | common::PointInRect (const POINT_ &p, const RECTI &r) |
Zwraca true, jeśli punkt należy do prostokąta. | |
bool | common::PointInRect (const VEC2 &p, const RECTF &r) |
bool | common::RectInRect (const RECTI &sr, const RECTI &r) |
Zwraca true, jeśli prostokąt sr zawiera się w całości wewnątrz r. | |
bool | common::RectInRect (const RECTF &sr, const RECTF &r) |
bool | common::RectToRect (const RECTI &r1, const RECTI &r2) |
Zwraca true, jeśli podane prostokąty zachodzą na siebie. | |
bool | common::RectToRect (const RECTF &r1, const RECTF &r2) |
bool | common::Intersection (RECTI *Out, const RECTI &r1, const RECTI &r2) |
Jeśli prostokąty posiadają część wspólną, zwraca ją przez Out i zwraca true. | |
bool | common::Intersection (RECTF *Out, const RECTF &r1, const RECTF &r2) |
void | common::Union (RECTI *Out, const RECTI &r1, const RECTI &r2) |
Zwraca prostokąt opisany na podanych dwóch prostokątach. | |
void | common::Union (RECTF *Out, const RECTF &r1, const RECTF &r2) |
void | common::Lerp (RECTF *out, const RECTF &v1, const RECTF &v2, float t) |
void | common::ClosestPointInRect (POINT_ *Out, const RECTI &Rect, const POINT_ &p) |
Wyznacza najbliższy punkt wewnątrz prostokąta względem punktu p. | |
void | common::ClosestPointInRect (VEC2 *Out, const RECTF &Rect, const VEC2 &p) |
Wyznacza najbliższy punkt wewnątrz prostokąta względem punktu p. | |
void | common::swap (BOX &b1, BOX &b2) |
void | common::Mul (BOX *Out, const BOX &b, const VEC3 &v) |
void | common::Div (BOX *Out, const BOX &b, const VEC3 &v) |
void | common::Mul (BOX *inout, const VEC3 &v) |
void | common::Div (BOX *inout, const VEC3 &v) |
bool | common::PointInBox (const VEC3 &p, const BOX &b) |
Zwraca true, jeśli punkt należy do boksa. | |
bool | common::BoxInBox (const BOX &sb, const BOX &b) |
Zwraca true, jeśli boks sb zawiera się w całości wewnątrz b. | |
bool | common::BoxToBox (const BOX &b1, const BOX &b2) |
Zwraca true, jeśli podane boksy zachodzą na siebie. | |
bool | common::Intersection (BOX *Out, const BOX &b1, const BOX &b2) |
Jeśli boksy posiadają część wspólną, zwraca ją przez Out i zwraca true. | |
void | common::Union (BOX *Out, const BOX &b1, const BOX &b2) |
Zwraca boks opisany na podanych dwóch boksach. | |
void | common::Lerp (BOX *out, const BOX &v1, const BOX &v2, float t) |
bool | common::ObbToObb (const OBB &a, const OBB &b) |
Zwraca true, jeśli dwa prostopadłościany OBB nachodzą na siebie. | |
void | common::swap (COLORF &c1, COLORF &c2) |
COLORF | common::operator* (float s, const COLORF &c) |
COLORF | common::operator/ (float s, const COLORF &c) |
COLOR | common::operator* (float s, const COLOR &c) |
COLOR | common::operator/ (float s, const COLOR &c) |
template<> | |
uint4 & | common::math_cast< uint4, COLOR > (const COLOR &x) |
template<> | |
unsigned long & | common::math_cast< unsigned long, COLOR > (const COLOR &x) |
template<> | |
COLOR & | common::math_cast< COLOR, uint4 > (const uint4 &x) |
template<> | |
COLOR & | common::math_cast< COLOR, unsigned long > (const unsigned long &x) |
template<> | |
D3DXCOLOR & | common::math_cast< D3DXCOLOR, COLORF > (const COLORF &x) |
template<> | |
COLORF & | common::math_cast< COLORF, D3DXCOLOR > (const D3DXCOLOR &x) |
void | common::ColorToColorf (COLORF *Out, COLOR c) |
Konwersje między tymi dwoma reprezentacjami kolorów. | |
COLOR | common::ColorfToColor (const COLORF &c) |
void | common::ColorToStr (tstring *Out, COLOR Color, char Format= 'X') |
Konwersja koloru na łańcuch. | |
void | common::ColorToStr (tstring *Out, const COLORF &Color, char Format= 'F') |
bool | common::StrToColor (COLOR *Out, const tstring &Str) |
Konwersja łańcucha na kolor. | |
bool | common::StrToColor (COLORF *Out, const tstring &Str) |
void | common::Add (COLORF *Out, const COLORF &c1, const COLORF &c2) |
void | common::Sub (COLORF *Out, const COLORF &c1, const COLORF &c2) |
void | common::Mul (COLORF *Out, const COLORF &c1, const COLORF &c2) |
void | common::Mul (COLORF *inout, const COLORF &c) |
void | common::Mul (COLORF *Out, const COLORF &c, float s) |
void | common::Div (COLORF *Out, const COLORF &c, float s) |
void | common::Negative (COLORF *Out, const COLORF &c) |
COLOR | common::ARGB_ABGR (COLOR color) |
Konwertuje kolor między systemami ARGB i ABGR. | |
uint2 | common::ColorToR5G6B5 (COLOR color) |
Konwertuje zwykły kolor COLOR (A8R8G8B8) na R5G6B5. | |
COLOR | common::R5G6B5ToColor (uint2 color) |
Konwertuje kolor R5G6B5 na zwykły kolor COLOR (A8R8G8B8). | |
void | common::Lerp (COLORF *Out, const COLORF &c1, const COLORF &c2, float t) |
COLOR | common::Lerp (COLOR c1, COLOR c2, float t) |
void | common::saturate (COLORF &v) |
void | common::HsbToRgb (COLORF *Out, float hue, float saturation, float brightness) |
Konwertuje kolor między HSB a RGB. | |
void | common::RgbToHsb (float *OutHue, float *OutSaturation, float *OutBrightness, const COLORF &Color) |
Konwertuje kolor RGB na HSB. | |
void | common::ColorRainbow (COLORF *Out, float t) |
Zwraca kolor tęczy od czerwonego (odpowiada mu t = 0) do niebieskiego (t = 1). | |
float | common::ColorToGrayscale (const COLORF &c) |
Zwraca jasność podanego koloru (odcień szarości) z zakresu 0..1. | |
float | common::ColorToGrayscale (COLOR &c) |
void | common::GrayscaleToColor (COLORF *Out, float t) |
Zwraca kolor szary o podanej jasności t = 0..1. | |
void | common::GrayscaleToColor (COLOR *Out, float t) |
void | common::AdjustContrast (COLORF *Color, float t) |
Zmienia kolorowi kontrast na miejscu. | |
void | common::AdjustSaturation (COLORF *Color, float t) |
Zmienia kolorowi nasycenie na miejscu. | |
COLOR | common::VectorToColor (const VEC3 &v) |
Przetwarza znormalizowany wektor na kolor XRGB. A zwraca 0. | |
void | common::ColorToVector (VEC3 *Out, COLOR color) |
Przetwarza kolor na wektor. | |
uint | common::ColorDistance (COLOR Color1, COLOR Color2) |
Zwraca "odległość" dwóch kolorów wg jakiejśtam byle jakiej metryki. Uwzględnia składowe R, G, B. | |
VEC4 | common::ColorfToVec4 (const COLORF &c) |
Converts between COLORF and VEC4, where (x,y,z,w) = (R,G,B,A). | |
COLORF | common::Vec4ToColorf (const VEC4 &v) |
PLANE | common::operator* (float s, const PLANE &p) |
void | common::swap (PLANE &p1, PLANE &p2) |
VEC3 & | common::GetPlaneNormal (PLANE &Plane) |
Daje dostęp do wektora normalnego podanej płaszczyzny, czyli jej składowych a, b, c zrzutowanych jako VEC3. | |
const VEC3 & | common::GetPlaneNormal (const PLANE &Plane) |
Zwraca wektor normalny płaszczyzny, czyli jej składowe a, b, c zrzutowane jako VEC3. | |
void | common::GetPlaneMemberPoint (VEC3 *Out, const PLANE &Plane) |
Zwraca jakiś punkt leżący na tej płaszczyźnie. | |
void | common::RecalcPlaneD (PLANE *Plane, const VEC3 &p) |
Zmienia odległość od początku układu współrzędnych. | |
bool | common::PlaneEqual (const PLANE &p1, const PLANE &p2) |
Zwraca true, jeśli podane płaszczyzny są sobie mniej więcej równe. | |
void | common::PointsToPlane (PLANE *Out, const VEC3 &p1, const VEC3 &p2, const VEC3 &p3) |
Tworzy płaszczyznę na podstawie trzech punktów. | |
void | common::PointNormalToPlane (PLANE *Out, const VEC3 &Point, const VEC3 &Normal) |
Tworzy płaszczyznę z wektora normalnego i punktu leżącego na tej płaszczyźnie. | |
void | common::Mul (PLANE *Out, const PLANE &p, float s) |
Skalowanie płaszczyzny. | |
void | common::Div (PLANE *Out, const PLANE &p, float s) |
float | common::Dot (const PLANE &p, const VEC4 &pt) |
Iloczyn skalarny płaszczyzny i punktu we współrzędnych jednorodnych. | |
float | common::DotCoord (const PLANE &p, const VEC3 &pt) |
Iloczyn skalarny płaszczyzny z punktem 3D: a*x+b*y+c*z+d*1. | |
float | common::DotNormal (const PLANE &p, const VEC3 &v) |
Iloczyn skalarny płaszczyzny z wektorem 3D: a*x+b*y+c*z+d*0. | |
void | common::Normalize (PLANE *Out, const PLANE &p) |
Normalizacja płaszczyzny. | |
void | common::Normalize (PLANE *p) |
Normalizacja płaszczyzny w miejscu. | |
void | common::GetBoxPlane (PLANE *out, const BOX &box, uint index) |
Returns plane of one of 6 possible box faces. | |
LINE2D | common::operator* (float s, const LINE2D &p) |
LINE2D | common::operator/ (float s, const LINE2D &p) |
VEC2 & | common::GetLineNormal (LINE2D &line) |
Daje dostęp do wektora normalnego podanej prostej, czyli jej składowych a, b zrzutowanych na VEC2. | |
const VEC2 & | common::GetLineNormal (const LINE2D &line) |
Zwraca wektor normalny prostej, czyli jej składowe a, b zrzutowane na VEC2. | |
bool | common::LineEqual (const LINE2D &p1, const LINE2D &p2) |
Zwraca true, jeśli podane proste są sobie mniej więcej równe. | |
void | common::swap (LINE2D &p1, LINE2D &p2) |
void | common::PointsToLine (LINE2D *Out, const VEC2 &p1, const VEC2 &p2) |
Tworzy prostą na podstwie dwóch punktów. | |
void | common::PointNormalToLine (LINE2D *Out, const VEC2 &Point, const VEC2 &Normal) |
Tworzy prostą z wektora normalnego i punktu leżącego na tej prostej. | |
bool | common::LinesParallel (const LINE2D &L1, const LINE2D &L2) |
Zwraca true, jeśli podane proste są równoległe. | |
bool | common::LinesPerpedicular (const LINE2D &L1, const LINE2D &L2) |
Zwraca true, jeśli podane proste są prostopadłe. | |
float | common::Dot (const LINE2D &L1, const LINE2D &L2) |
Zwraca dot z wektorów normalnych dwóch prostych. | |
float | common::LineDistance (const LINE2D &L1, const LINE2D &L2) |
Zwraca signed odległość dwóch prostych na płaszczyźnie. | |
bool | common::LinesIntersection (VEC2 *Out, const LINE2D &L1, const LINE2D &L2) |
Oblicza punkt przeciecia dwóch prostych. | |
bool | common::PointsColinear (const VEC2 &p1, const VEC2 &p2, const VEC2 &p3) |
Zwraca true, jeśli podane trzy punkty leżą na jednej prostej. | |
void | common::Mul (LINE2D *Out, const LINE2D &p, float s) |
Skalowanie prostej. | |
void | common::Div (LINE2D *Out, const LINE2D &p, float s) |
float | common::Dot (const LINE2D &p, const VEC3 &pt) |
Iloczyn skalarny płaszczyzny i punktu we współrzędnych jednorodnych 2D. | |
float | common::DotCoord (const LINE2D &p, const VEC2 &pt) |
Iloczyn skalarny prostej 2D z punktem 2D: a*x + b*y + c*1. | |
float | common::DotNormal (const LINE2D &p, const VEC2 &v) |
Iloczyn skalarny prostej 2D z wektorem 2D: a*x + b*y + c*z + d*0. | |
void | common::Normalize (LINE2D *Out, const LINE2D &p) |
Normalizacja prostej 2D. | |
void | common::Normalize (LINE2D *p) |
Normalizacja prostej w miejscu. | |
void | common::GetRectLine (LINE2D *out, const RECTF &rect, uint index) |
Returns line of one of 4 possible box edges. | |
void | common::MatrixToStr (tstring *Out, const MATRIX &m) |
bool | common::StrToMatrix (MATRIX *Out, const tstring &Str) |
void | common::swap (MATRIX &m1, MATRIX &m2) |
bool | common::MatrixEqual (const MATRIX &m1, const MATRIX &m2) |
Zwraca true, jeśli podane macierze są sobie mniej więcej równe. | |
void | common::Minus (MATRIX *m) |
Negacja macierzy w miejscu. | |
void | common::Add (MATRIX *Out, const MATRIX &m1, const MATRIX &m2) |
Dodawanie macierzy. | |
void | common::Sub (MATRIX *Out, const MATRIX &m1, const MATRIX &m2) |
Odejmowanie macierzy. | |
void | common::Mul (MATRIX *Out, const MATRIX &m1, const MATRIX &m2) |
Mnożenie macierzy. | |
void | common::Mul (MATRIX *m, float s) |
Mnożenie macierzy przez skalar w miejscu. | |
void | common::Div (MATRIX *m, float s) |
Dzielenie macierzy przez skalar w miejscu. | |
void | common::Mul3x3 (MATRIX &out, const MATRIX &m1, const MATRIX &m2) |
Multiplication of 3x3 submatrices. | |
void | common::Mul4x3 (MATRIX &out, const MATRIX &m1, const MATRIX &m2) |
Multiplication of 4x3 submatrices. | |
void | common::Transform (VEC4 *Out, const VEC2 &v, const MATRIX &m) |
Mnożenie wektora 2D jako [x,y,0,1] przez macierz, wychodzi wektor 4D. | |
void | common::Transform (VEC2 *Out, const VEC2 &v, const MATRIX &m) |
Mnożenie wektora 2D jako [x,y,0,1] przez macierz z olaniem wyjściowego W. | |
void | common::TransformCoord (VEC2 *Out, const VEC2 &v, const MATRIX &m) |
Mnożenie wektora 2D jako [x,y,0,1] przez macierz i sprowadzenie z powrotem do 2D przez podzielenie przez W. | |
void | common::TransformNormal (VEC2 *Out, const VEC2 &v, const MATRIX &m) |
Mnożenie wektora 2D jako [x,y,0,0] przez macierz. | |
void | common::Transform (VEC4 *Out, const VEC3 &v, const MATRIX &m) |
Mnożenie wektora 3D jako [X,Y,Z,1] przez macierz, wychodzi wektor 4D. | |
void | common::Transform (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnożenie wektora 3D jako [X,Y,Z,1] przez macierz z olaniem wyjściowego W. | |
void | common::TransformCoord (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnożenie wektora 3D jako [X,Y,Z,1] przez macierz i sprowadzenie z powrotem do 3D przez podzielenie przez W. | |
void | common::TransformNormal (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnożenie wektora 3D jako [X,Y,Z,0] przez macierz. | |
void | common::TransformArray (VEC3 OutPoints[], const VEC3 InPoints[], size_t PointCount, const MATRIX &M) |
Przekształca na raz całą tablicę wektorów - w miejscu lub z tablicy wejściowej do wyjściowej. | |
void | common::TransformArray (VEC3 InOutPoints[], size_t PointCount, const MATRIX &M) |
void | common::TransformNormalArray (VEC3 OutPoints[], const VEC3 InPoints[], size_t PointCount, const MATRIX &M) |
void | common::TransformNormalArray (VEC3 InOutPoints[], size_t PointCount, const MATRIX &M) |
void | common::TransformCoordArray (VEC3 OutPoints[], const VEC3 InPoints[], size_t PointCount, const MATRIX &M) |
void | common::TransformCoordArray (VEC3 InOutPoints[], size_t PointCount, const MATRIX &M) |
void | common::Transform (VEC4 *Out, const VEC4 &v, const MATRIX &m) |
Mnożenie wektora 4D przez macierz. | |
void | common::TransformNormalByTranspose (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnoży wektor przez transpozycję podanej macierzy m (jej podmacierzy 3x3). | |
void | common::Untransform (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnoży punkt przez odwrotnosć podanej macierzy m (jej podmacierzy 4x3), ale bez odwracania. | |
void | common::UntransformNormal (VEC3 *Out, const VEC3 &v, const MATRIX &m) |
Mnoży wektor przez odwrotnosć podanej macierzy m (jej podmacierzy 3x3), ale bez odwracania. | |
void | common::Transform (PLANE *Out, const PLANE &p, const MATRIX &m) |
Przekształca płaszczyznę przez macierz. | |
void | common::TransformRay (VEC3 *OutOrigin, VEC3 *OutDir, const VEC3 &RayOrigin, const VEC3 &RayDir, const MATRIX &m) |
Przekształca promień przez macierz. | |
void | common::TransformBox (BOX *Out, const BOX &In, const MATRIX &M) |
Przekształca AABB przez podaną macierz i wylicza AABB tego co wyszło po przekształceniu. | |
void | common::TransformBoxCoord (BOX *Out, const BOX &In, const MATRIX &M) |
Przekształca AABB przez podaną macierz i wylicza AABB tego co wyszło po przekształceniu. | |
void | common::MatrixSetTranslation (MATRIX *InOut, float TranslationX, float TranslationY, float TranslationZ) |
Ustawia translację w macierzy. | |
void | common::MatrixSetTranslation (MATRIX *InOut, const VEC3 &Translation) |
Ustawia translację w macierzy. | |
void | common::MatrixGetTranslation (float *OutTranslationX, float *OutTranslationY, float *OutTranslationZ, const MATRIX &m) |
Pobiera translację z macierzy. | |
void | common::MatrixGetTranslation (VEC3 *OutTranslation, const MATRIX &m) |
Pobiera translację z macierzy. | |
void | common::AxesToMatrix (MATRIX *Out, const VEC3 &AxisX, const VEC3 &AxisY, const VEC3 &AxisZ) |
Tworzy macierz przekształcającą do lokalnego układu współrzędnych wyznaczonego przez podane 3 osie. | |
void | common::AxesToMatrixTranslation (MATRIX *Out, const VEC3 &Origin, const VEC3 &AxisX, const VEC3 &AxisY, const VEC3 &AxisZ) |
Tworzy macierz przekształcającą do lokalnego układu współrzędnych wyznaczonego przez podane 3 osie i pozycję początku tego układu. | |
void | common::LookAtLH (MATRIX *Out, const VEC3 &Eye, const VEC3 &Forward, const VEC3 &Up) |
Macierz kamery. | |
void | common::LookAtRH (MATRIX *Out, const VEC3 &Eye, const VEC3 &Forward, const VEC3 &Up) |
void | common::Identity (MATRIX *Out) |
Tworzy macierz identycznościową. | |
void | common::Translation (MATRIX *Out, float x, float y, float z) |
Tworzy macierz translacji (przesuwania). | |
void | common::Translation (MATRIX *Out, const VEC3 &v) |
void | common::Scaling (MATRIX *Out, float sx, float sy, float sz) |
Tworzy macierz skalowania (powiększania, pomniejszania, rozciągania). | |
void | common::Scaling (MATRIX *Out, const VEC3 &sv) |
void | common::Scaling (MATRIX *Out, float s) |
void | common::ScalingAxis (MATRIX *Out, const VEC3 &n, float k) |
Tworzy macierz skalowania wzdłuż podanego kierunku. | |
void | common::Rotation2D (MATRIX *Out, float Angle) |
Macierz obrotu 2D. | |
void | common::RotationX (MATRIX *Out, float Angle) |
Macierz obrotu wokół osi X. | |
void | common::RotationY (MATRIX *Out, float Angle) |
Macierz obrotu wokół osi Y. | |
void | common::RotationZ (MATRIX *Out, float Angle) |
Macierz obrotu wokół osi Z. | |
void | common::RotationAxisLH (MATRIX *Out, const VEC3 &Axis, float Angle) |
void | common::RotationAxisRH (MATRIX *Out, const VEC3 &Axis, float Angle) |
void | common::RotationYawPitchRoll (MATRIX *Out, float Yaw, float Pitch, float Roll) |
Macierz obrotu wokół trzech osi w kolejności Yaw-Pitch-Roll (ZXY) - tzw. kąty Eulera. | |
void | common::RotationYawPitchRoll (MATRIX *Out, const VEC3 &EulerAngles) |
void | common::RotationYawPitchRollInv (MATRIX *Out, float Yaw, float Pitch, float Roll) |
Przekształca ze wsp. świata do obiektu (interial -> object space). | |
void | common::RotationYawPitchRollInv (MATRIX *Out, const VEC3 &EulerAngles) |
void | common::OrthoLH (MATRIX *Out, float Width, float Height, float ZNear, float ZFar) |
Tworzy macierz rzutowania ortogonalnego. | |
void | common::OrthoRH (MATRIX *Out, float Width, float Height, float ZNear, float ZFar) |
void | common::OrthoOffCenterLH (MATRIX *Out, float Left, float Right, float Bottom, float Top, float ZNear, float ZFar) |
void | common::OrthoOffCenterRH (MATRIX *Out, float Left, float Right, float Bottom, float Top, float ZNear, float ZFar) |
void | common::PerspectiveLH (MATRIX *Out, float Width, float Height, float ZNear, float ZFar) |
Tworzy macierz rzutowania perspektywicznego. | |
void | common::PerspectiveRH (MATRIX *Out, float Width, float Height, float ZNear, float ZFar) |
void | common::PerspectiveFovLH (MATRIX *Out, float FovY, float Aspect, float ZNear, float ZFar) |
void | common::PerspectiveFovRH (MATRIX *Out, float FovY, float Aspect, float ZNear, float ZFar) |
void | common::PerspectiveOffCenterLH (MATRIX *Out, float Left, float Right, float Bottom, float Top, float ZNear, float ZFar) |
void | common::PerspectiveOffCenterRH (MATRIX *Out, float Left, float Right, float Bottom, float Top, float ZNear, float ZFar) |
void | common::PerspectiveFovLH_Inf (MATRIX *Out, float FovY, float Aspect, float ZNear) |
Wersja tworząca macierz z Z-Far = INFINITY. | |
void | common::MatrixShadow (MATRIX *Out, const VEC4 &Light, const PLANE &Plane) |
Tworzy macierz spłaszczającą geometrię na podaną płaszczyznę w podanym kierunku padania światła. | |
void | common::MatrixReflect (MATRIX *Out, const PLANE &p) |
Tworzy macierz odbijającą geometrię względem podanej płaszczyzny. | |
void | common::Transpose (MATRIX *m) |
Transpozycja macierzy na miejscu. | |
void | common::Transpose (MATRIX *Out, const MATRIX &m) |
Transpozycja macierzy. | |
void | common::Lerp (MATRIX *Out, const MATRIX &m1, const MATRIX &m2, float t) |
Interpolacja liniowa macierzy. | |
float | common::Det (const MATRIX &m) |
Wyznacznik macierzy. | |
bool | common::Inverse (MATRIX *Out, const MATRIX &m) |
Odwrotność macierzy. | |
void | common::Matrix33ToMatrix (MATRIX *Out, const MATRIX33 &m) |
Konwertuje macierz 3x3 na macierz 4x4. | |
void | common::MatrixToMatrix33 (MATRIX33 *Out, const MATRIX &m) |
Wyciąga podmacierz 3x3 z macierzy 4x4. | |
void | common::Identity (MATRIX33 *Out) |
Tworzy macierz identycznościową. | |
void | common::Transpose (MATRIX33 *m) |
Transpozycja macierzy na miejscu. | |
void | common::Transpose (MATRIX33 *Out, const MATRIX33 &m) |
Transpozycja macierzy. | |
QUATERNION | common::operator* (const QUATERNION pt, float v) |
QUATERNION | common::operator/ (const QUATERNION pt, float v) |
QUATERNION | common::operator* (float v, const QUATERNION pt) |
QUATERNION | common::operator/ (float v, const QUATERNION pt) |
void | common::swap (QUATERNION &v1, QUATERNION &v2) |
float | common::CalcQuaternionAngle (const QUATERNION &Q) |
Zwraca kąt obrotu jaki reprezentuje ten kwaternion. | |
void | common::CalcQuaternionAxis (VEC3 *Out, const QUATERNION &Q) |
Zwraca oś obrotu jaką reprezentuje ten kwaternion. | |
bool | common::QuaternionEqual (const QUATERNION &q1, const QUATERNION &q2) |
Zwraca true, jeśli podane kwaterniony są sobie mniej więcej równe. | |
void | common::Minus (QUATERNION *q) |
Ujemny kwaternion. | |
void | common::Minus (QUATERNION *Out, const QUATERNION &q) |
void | common::Add (QUATERNION *Out, const QUATERNION &q1, const QUATERNION &q2) |
Dodawanie, odejmowanie, mnożenie kwaternionów. | |
void | common::Sub (QUATERNION *Out, const QUATERNION &q1, const QUATERNION &q2) |
void | common::Mul (QUATERNION *Out, const QUATERNION &q1, const QUATERNION &q2) |
void | common::Mul (QUATERNION *q, float v) |
Mnożenie i dzielenie kwaterniona przez skalar. | |
void | common::Div (QUATERNION *q, float v) |
void | common::Mul (QUATERNION *Out, const QUATERNION &q, float v) |
void | common::Div (QUATERNION *Out, const QUATERNION &q, float v) |
void | common::RotationMatrixToQuaternion (QUATERNION *Out, const MATRIX &RotationMatrix) |
Tworzy kwaternion na podstawie macierzy obrotu. | |
void | common::QuaternionToRotationMatrix (MATRIX *Out, const QUATERNION &q) |
Przekształca kwaternion w macierz obrotu. | |
void | common::QuaternionTransform (VEC3 *Out, const VEC3 &p, const QUATERNION &q) |
Przekształca punkt/wektor przez kwaternion obracając go o ten kwaternion. | |
void | common::EulerAnglesToQuaternionO2I (QUATERNION *Out, float Yaw, float Pitch, float Roll) |
Konwersja kątów Eulera na kwaternion (który obraca ze wsp. obiektu do świata, czyli object -> interial space) [a może odwrotnie?]. | |
void | common::EulerAnglesToQuaternionI2O (QUATERNION *Out, float Yaw, float Pitch, float Roll) |
Konwersja kątów Eulera na kwaternion (który obraca ze wsp. świata do obiektu, czyli interial -> object space) [a może odwrotnie?]. | |
void | common::QuaternionO2IToEulerAngles (float *Yaw, float *Pitch, float *Roll, const QUATERNION &q) |
Konwersja kwaterniona który obraca ze wsp. obiektu do świata, czyli object -> interial space, na kąty Eulera. | |
void | common::QuaternionI2OToEulerAngles (float *Yaw, float *Pitch, float *Roll, const QUATERNION &q) |
Konwersja kwaterniona który obraca ze wsp. świata do obiektu, czyli interial -> object space, na kąty Eulera. | |
void | common::QuaternionRotationX (QUATERNION *Out, float a) |
Tworzy kwaternion obracający wokół osi X. | |
void | common::QuaternionRotationY (QUATERNION *Out, float a) |
Tworzy kwaternion obracający wokół osi Y. | |
void | common::QuaternionRotationZ (QUATERNION *Out, float a) |
Tworzy kwaternion obracający wokół osi Z. | |
void | common::AxisToQuaternion (QUATERNION *Out, const VEC3 &Axis, float Angle) |
Tworzy kwaternion na podstawie osi obrotu i kąta. | |
void | common::QuaternionDiff (QUATERNION *Out, const QUATERNION &a, const QUATERNION &b) |
Oblica "różnicę" dwóch kwaternionów reprezentującą taki obrót że a*Out = b. | |
void | common::Conjugate (QUATERNION *q) |
Kwaternion sprzężony do danego. | |
void | common::Conjugate (QUATERNION *Out, const QUATERNION &q) |
void | common::Inverse (QUATERNION *Out, const QUATERNION &q) |
Odwrotność kwaterniona. | |
void | common::Normalize (QUATERNION *Out, const QUATERNION &q) |
Normalizacja kwaternion. | |
void | common::Normalize (QUATERNION *InOut) |
float | common::Dot (const QUATERNION &q1, const QUATERNION &q2) |
Iloczyn skalarny dwóch kwaternionów. | |
float | common::LengthSq (const QUATERNION &q) |
Kwadrat długości kwaterniona. | |
float | common::Length (const QUATERNION &q) |
Długość kwaterniona. | |
void | common::Log (QUATERNION *Out, const QUATERNION &q) |
void | common::Exp (QUATERNION *Out, const QUATERNION &q) |
void | common::Pow (QUATERNION *InOut, float t) |
Podnieś kwaternion do potęgi. | |
void | common::Pow (QUATERNION *Out, const QUATERNION &q, float t) |
void | common::Lerp (QUATERNION *Out, const QUATERNION &q1, const QUATERNION &q2, float t) |
Interpolacja normalna kwaternionów. | |
void | common::Slerp (QUATERNION *Out, const QUATERNION &q0, const QUATERNION &q1, float t) |
Interpolacja sferyczna kwaternionów. | |
void | common::Squad (QUATERNION *Out, const QUATERNION &Q1, const QUATERNION &A, const QUATERNION &B, const QUATERNION &C, float t) |
void | common::SquadSetup (QUATERNION *OutA, QUATERNION *OutB, QUATERNION *OutC, const QUATERNION &Q0, const QUATERNION &Q1, const QUATERNION &Q2, const QUATERNION &Q3) |
void | common::Affine2dToStr (tstring *Out, const AFFINE2D &aff) |
bool | common::StrToAffine2d (AFFINE2D *Out, const tstring &Str) |
void | common::swap (AFFINE2D &aff1, AFFINE2D &aff2) |
void | common::Mul (AFFINE2D &out, const AFFINE2D &lhs, const AFFINE2D &rhs) |
Per component multiplication. | |
void | common::Div (AFFINE2D &out, const AFFINE2D &lhs, const AFFINE2D &rhs) |
Per component division. | |
void | common::Transform (VEC2 &out, const VEC2 &v, const AFFINE2D &aff) |
2D point transformation, including translation. | |
void | common::TransformNormal (VEC2 &out, const VEC2 &v, const AFFINE2D &aff) |
2D vector transformation by 2x2 submatrix, with no translation. | |
void | common::Translation (AFFINE2D &out, const VEC2 &v) |
void | common::Translation (AFFINE2D &out, float x, float y) |
void | common::Scaling (AFFINE2D &out, float s) |
void | common::Scaling (AFFINE2D &out, const VEC2 &v) |
void | common::Scaling (AFFINE2D &out, float x, float y) |
void | common::Rotation (AFFINE2D &out, float angle) |
void | common::Transpose (AFFINE2D &inout) |
Transposes the 2x2 submatrix. | |
void | common::Lerp (AFFINE2D &out, const AFFINE2D &lhs, const AFFINE2D &rhs, float t) |
void | common::Inverse (AFFINE2D &out, const AFFINE2D &aff) |
void | common::Affine2dToMatrix (MATRIX &out, const AFFINE2D &aff) |
void | common::MatrixToAffine2d (AFFINE2D &out, const MATRIX &m) |
float | common::CapsuleVolume (const VEC3 &p1, const VEC3 &p2, float R) |
Objętość kapsuły. | |
void | common::RandomPointInCapsule (VEC3 *Out, const VEC3 &p1, const VEC3 &p2, float R, RandomGenerator &Rand) |
Losuje punkt z wnętrza kapsuły. Rozkład równomierny. | |
void | common::RandomPointInCapsule (VEC3 *Out, const VEC3 &p1, const VEC3 &p2, float R) |
template<typename T > | |
void | common::SmoothCD_T (T *InOutPos, const T &Dest, T *InOutVel, float SmoothTime, float TimeDelta) |
template<> | |
void | common::SmoothCD_T< float > (float *InOutPos, const float &Dest, float *InOutVel, float SmoothTime, float TimeDelta) |
template<> | |
void | common::SmoothCD_T< VEC2 > (VEC2 *InOutPos, const VEC2 &Dest, VEC2 *InOutVel, float SmoothTime, float TimeDelta) |
template<> | |
void | common::SmoothCD_T< VEC3 > (VEC3 *InOutPos, const VEC3 &Dest, VEC3 *InOutVel, float SmoothTime, float TimeDelta) |
void | common::SphericalToCartesian (VEC3 *Out, float Yaw, float Pitch, float R) |
Tu można podawać co się chce. | |
void | common::CartesianToSpherical (float *OutYaw, float *OutPitch, float *OutR, const VEC3 &Pos) |
void | common::ConvexHull2D (std::vector< VEC2 > *OutPoints, const VEC2 InPoints[], size_t InPointCount) |
Zwraca wypukłą otoczkę zbioru punktów 2D. | |
template<typename T > | |
void | common::EvalCatmullRomCurve (T *out, const T &a, const T &b, const T &c, const T &d, float t) |
Calculates value of Catmull-Rom curve at given point t = 0..1 between points b and c. | |
template<typename T > | |
void | common::EvalCatmullRomCurveDiff (T *out, const T &a, const T &b, const T &c, const T &d, float t) |
Evaluates tangent (not normalized) of Catmull-Rom curve at given point t = 0..1 between points b and c. | |
template<typename T > | |
void | common::EvalQuadraticBezierCurve (T *out, const T &a, const T &b, const T &c, float t) |
Calculates value of quadratic Bezier curve at given point t = 0..1 between points a and c. | |
template<typename T > | |
void | common::EvalCubicBezierCurve (T *out, const T &a, const T &b, const T &c, const T &d, float t) |
Calculates value of cubic Bezier curve at given point t = 0..1 between points a and d. | |
template<typename T > | |
void | common::EvalCubicBezierCurveDiff (T *out, const T &a, const T &b, const T &c, const T &d, float t) |
Evaluates tangent (not normalized) of cubic Bezier curve at given point t = 0..1 between points a and d. | |
template<typename T > | |
void | common::SplitCubicBezierCurve (T out1[4], T out2[4], const T &a, const T &b, const T &c, const T &d) |
Splits cubic Bezier curve in the middle (at t=0.5) into two cubic Bezier curves. | |
template<typename T > | |
void | common::SplitCubicBezierCurve (T out1[4], T out2[4], const T &a, const T &b, const T &c, const T &d, float t) |
Splits cubic Bezier curve in the given point (at parameter t) into two cubic Bezier curves. | |
float | common::CalcCubicBezierCurveLength (const VEC3 &a, const VEC3 &b, const VEC3 &c, const VEC3 &d, float t1, float t2) |
float | common::GetCubicBezierCurveArcLengthParam (const VEC3 &a, const VEC3 &b, const VEC3 &c, const VEC3 &d, float len, float epsilon) |
bool | common::IntersectCubicBezierCurve2DWithX (const VEC2 curve[4], float x, float eps, float *outY, float *outT, float t0=0.f, float t1=1.f) |
Calculates Y value and T parameter of cubic Bezier curve intersected with axis-aligned line x. | |
float | common::Orient2D (const VEC2 &a, const VEC2 &b, const VEC2 &c) |
Funkcja wielofunkcyjna. | |
float | common::Orient3D (const VEC3 &a, const VEC3 &b, const VEC3 &c, const VEC3 &d) |
Funkcja wielofunkcyjna. | |
bool | common::PointInCircle (const VEC2 &pt, const VEC2 &circleCenter, float circleRadius) |
bool | common::PointInTriangle (const VEC2 &p, const VEC2 &a, const VEC2 &b, const VEC2 &c) |
Zwraca true, jeśli punkt p należy do trójkąta abc. | |
bool | common::IsQuadConvex (const VEC2 &a, const VEC2 &b, const VEC2 &c, const VEC2 &d) |
Zwraca true, jeśli podany czworokąt jest wypukły. | |
bool | common::IsQuadConvex (const VEC3 &a, const VEC3 &b, const VEC3 &c, const VEC3 &d) |
Zwraca true, jeśli podany czworokąt jest wypukły (nie zdegenerowany, nie wklęsły, nie samoprzecinający się). | |
float | common::ClosestPointOnLine (const VEC3 &p, const VEC3 &RayOrig, const VEC3 &RayDir) |
Dany punkt p i promień (RayOrig, RayDir), oblicza parametr t dla punktu na tym promieniu będącego rzutem tego punktu na ten promień. | |
float | common::ClosestPointSegmentSegment (const VEC3 &Seg1_Beg, const VEC3 &Seg1_End, const VEC3 &Seg2_Beg, const VEC3 &Seg2_End, float &OutSeg1_t, float &OutSeg2_t, VEC3 &OutSeg1_pt, VEC3 &OutSeg2_pt) |
Oblicza najbliższe sobie punkty na dwóch odcinkach. | |
float | common::PointToLineDistanceSq (const VEC2 &P, const VEC2 &LineOrig, const VEC2 &LineDir) |
Zwraca kwadrat odległości punktu od prostej. | |
float | common::PointToLineDistanceSq (const VEC3 &P, const VEC3 &LineOrig, const VEC3 &LineDir) |
float | common::PointToSegmentDistanceSq (const VEC2 &p, const VEC2 &segment_p1, const VEC2 &segment_p2) |
Zwraca kwadrat odległości punktu od odcinka. | |
float | common::PointToSegmentDistanceSq (const VEC3 &p, const VEC3 &segment_p1, const VEC3 &segment_p2) |
Zwraca kwadrat odległości punktu od odcinka. | |
bool | common::PointOnLine (const VEC3 &P, const VEC3 &LineOrig, const VEC3 &LineDir) |
Zwraca true, jeśli punkt leży na prostej. | |
float | common::PointToLine (const VEC3 &P, const VEC3 &LineOrig, const VEC3 &LineDir) |
Zwraca parametr T punktu leżącego na prostej. | |
bool | common::PointInLineSegment (const VEC3 &P, const VEC3 &SegmentBeg, const VEC3 &SegmentEnd) |
Zwraca true, jeśli punkt leży na odcinku. | |
float | common::ClosestPointOnSegment (VEC2 *Out, const VEC2 &p, const VEC2 &p1, const VEC2 &p2) |
Wyznacza najbliższy punkt leżący na odcinku p1-p2 względem punktu p. | |
float | common::ClosestPointOnSegment (VEC3 *Out, const VEC3 &p, const VEC3 &p1, const VEC3 &p2) |
float | common::ClosestPointOnRay (VEC2 *Out, const VEC2 &p, const VEC2 &RayOrig, const VEC2 &RayDir) |
Wyznacza najbliższy punkt leżący na półprostej względem punktu p. | |
float | common::ClosestPointOnRay (VEC3 *Out, const VEC3 &p, const VEC3 &RayOrig, const VEC3 &RayDir) |
void | common::ClosestPointInBox (VEC3 *Out, const BOX &Box, const VEC3 &p) |
Wyznacza najbliższy punkt wewnątrz prostopadłościanu względem punktu p. | |
void | common::ClosestPointInObb (VEC3 *OutPoint, const VEC3 &Point, const OBB &Obb) |
Znajduje punkt OutPoint należący do podanego OBB, najbliższy do punktu Point. | |
void | common::ClosestPointInRect3d (VEC3 *OutPoint, const VEC3 &Point, const RECT3D &Rect3d) |
Znajduje punkt OutPoint należący do podanego prostokąta 3D, najbliższy do punktu Point. | |
void | common::ClosestPointInRect3d (VEC3 *OutPoint, const VEC3 &p, const VEC3 &a, const VEC3 &b, const VEC3 &c) |
Znajduje punkt OutPoint należący do podanego prostokąta 3D wyznaczonego przez trzy wierzchołki: a, b, c, najbliższy do punktu Point. | |
void | common::ClosestPointInTriangle (VEC3 *OutPoint, const VEC3 &p, const VEC3 &a, const VEC3 &b, const VEC3 &c) |
Znajduje punkt OutPoint należący do trójkąta (a, b, c) najbliższy do punktu p. | |
void | common::ClosestPointInTriangle (VEC2 *out, const VEC2 &pt, const VEC2 &triA, const VEC2 &triB, const VEC2 &triC) |
void | common::ClosestPointInTetrahedron (VEC3 *OutPoint, const VEC3 &p, const VEC3 &a, const VEC3 &b, const VEC3 &c, const VEC3 &d) |
Znajduje punkt OutPoint należący do podanego czworościanu wyznaczonego przez wierzchołki: a, b, c, d, najbliższy do punktu p. | |
float | common::PointToRectDistanceSq (const VEC2 &p, const RECTF &rect) |
Returns squared distance from point to rectangle. Returns 0 if point inside rectangle. | |
float | common::PointToRectManhattanDistance (const VEC2 &p, const RECTF &rect) |
float | common::PointToRectMaxDistance (const VEC2 &p, const RECTF &rect) |
float | common::PointToBoxDistanceSq (const VEC3 &p, const BOX &box) |
Kwadrat odległości punktu od prostopadłościanu. | |
float | common::PointToBoxManhattanDistance (const VEC3 &p, const BOX &box) |
float | common::PointToBoxMaxDistance (const VEC3 &p, const BOX &box) |
float | common::RectToRectDistanceSq (const RECTF &rect1, const RECTF &rect2) |
Returns squared distance between two rectangles. Returns 0 if given rectangles overlap. | |
float | common::RectToRectManhattanDistance (const RECTF &rect1, const RECTF &rect2) |
float | common::RectToRectMaxDistance (const RECTF &rect1, const RECTF &rect2) |
float | common::BoxToBoxDistanceSq (const BOX &box1, const BOX &box2) |
Returns squared distance between two axis-aligned boxes. Returns 0 if given boxes overlap. | |
float | common::BoxToBoxManhattanDistance (const BOX &box1, const BOX &box2) |
float | common::BoxToBoxMaxDistance (const BOX &box1, const BOX &box2) |
float | common::PointToObbDistanceSq (const VEC3 &Point, const OBB &Obb) |
Kwadrat odległości punktu od OBB. | |
bool | common::CircleToRect (const VEC2 &circleCenter, float circleRadius, const RECTF &rect) |
bool | common::PointInSphere (const VEC3 &p, const VEC3 &SphereCenter, float SphereRadius) |
Zwraca true, jeśli podany punkt należy do sfery. | |
float | common::PointToSphereDistance (const VEC3 &p, const VEC3 &SphereCenter, float SphereRadius) |
Zwraca odległość punktu od powierzchni sfery. | |
void | common::ClosestPointOnSphere (VEC3 *Out, const VEC3 &SphereCenter, float SphereRadius, const VEC3 &p) |
Wyznacza najbliższy punkt na powierzchni sfery względem punktu p. | |
bool | common::PointOnPlane (const VEC3 &p, const PLANE &plane) |
Zwraca true, jeśli podany punkt należy do płaszczyzny. | |
void | common::ClosestPointOnPlane (VEC3 *Out, const PLANE &Plane, const VEC3 &p) |
Wyznacza najbliższy punkt na płaszczyźnie względem punktu p. | |
bool | common::PointInTriangle (const VEC3 &point, const VEC3 &pa, const VEC3 &pb, const VEC3 &pc) |
Zwraca true, jeśli punkt należy do trójkąta. | |
bool | common::PointInFrustum (const VEC3 &p, const FRUSTUM_PLANES &Frustum) |
Zwraca true, jeśli punkt należy do wnętrza podanego frustuma. | |
bool | common::PointInFrustum (const VEC3 &p, const FRUSTUM_RADAR &Frustum) |
bool | common::ClosestPointsOnLines (float *OutT1, float *OutT2, const VEC3 &RayOrig1, const VEC3 &RayDir1, const VEC3 &RayOrig2, const VEC3 &RayDir2) |
Funkcja wyznacza parametry t1 i t2 dla punktów na dwóch prostych, w których te proste są najbliżej siebie. | |
bool | common::RayToBox (float *OutT, const VEC3 &RayOrig, const VEC3 &RayDir, const BOX &Box) |
Kolizja promienia z prostopadłościanem. | |
bool | common::RayToSphere (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 &SphereCenter, float SphereRadius, float *OutT) |
Wylicza kolizję promienia ze sferą. | |
bool | common::RayToPlane (const VEC3 &RayOrig, const VEC3 &RayDir, const PLANE &Plane, float *OutT, float *OutVD) |
Przecięcie promienia z płaszczyzną. | |
bool | common::RayToTriangle (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 &p0, const VEC3 &p1, const VEC3 &p2, bool BackfaceCulling, float *OutT) |
Kolizja promienia z trójkątem. | |
bool | common::RayToQuad (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 QuadPoints[4], VEC3 *OutPoint=NULL) |
Kolizja promienia z czworokątem w 3D. | |
bool | common::RayToFrustum (const VEC3 &RayOrig, const VEC3 &RayDir, const FRUSTUM_PLANES &Frustum, float *t_near, float *t_far) |
Kolizja promienia z frustumem. | |
bool | common::RayToCylinder (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 &CylinderBeg, const VEC3 &CylinderEnd, float CylinderRadius, float *OutT) |
Kolizja promienia z dowolnie zorientowanym cylindrem. | |
bool | common::PointInConvexPolyhedron (const VEC3 &Point, const PLANE PolyhedronPlanes[], size_t PolyhedronPlaneCount) |
Czy punkt leży wewnątrz wielościana wypukłego. | |
bool | common::PointInConvexPolyhedron (const VEC3 &Point, const void *PolyhedronPlanes, size_t PolyhedronPlaneCount, int PolyhedronPlaneStride) |
bool | common::RayToConvexPolyhedron (const VEC3 &RayOrig, const VEC3 &RayDir, const PLANE PolyhedronPlanes[], size_t PolyhedronPlaneCount, float *OutBegT, float *OutEndT) |
Kolizja promienia z wielościanem wypukłym. | |
bool | common::RayToConvexPolyhedron (const VEC3 &RayOrig, const VEC3 &RayDir, const void *PolyhedronPlanes, size_t PolyhedronPlaneCount, int PolyhedronPlaneStride, float *OutBegT, float *OutEndT) |
bool | common::SphereToBox (const VEC3 &SphereCenter, float SphereRadius, const BOX &Box) |
Zwraca true jeśli kula koliduje z prostopadłościanem (także jeśli jest w jego środku). | |
bool | common::SphereToObb (const VEC3 &SphereCenter, float SphereRadius, const OBB &Obb) |
Zwraca true, jeśli sfera koliduje z prostopadłościanem zorientowanym. | |
bool | common::SphereToTriangle (const VEC3 &SphereCenter, float SphereRadius, const VEC3 &TriA, const VEC3 &TriB, const VEC3 &TriC) |
Zwraca true, jeśli sfera koliduje z trójkątem. | |
bool | common::SphereInBox (const VEC3 &SphereCenter, float SphereRadius, const BOX &Box) |
Zwraca true, jeśli sfera zawiera się w całości w prostopadłościanie. | |
bool | common::BoxInSphere (const BOX &Box, const VEC3 &SphereCenter, float SphereRadius) |
Zwraca true, jeśli prostopadłościan zawiera się w całości w sferze. | |
int | common::ClassifyBoxToPlane (const PLANE &plane, const BOX &box) |
Klasyfikuje położenie prostopadłościanu względem płaszczyzny. | |
int | common::ClassifyObbToPlane (const PLANE &Plane, const OBB &Obb) |
Klasyfikuje położenie zorientowanego prostopadłościanu OBB względem płaszczyzny. Zwraca -1, 0, 1. | |
bool | common::PlaneToBox (const PLANE &plane, const BOX &box) |
Kolizja płaszczyzny z prostopadłościanem. | |
bool | common::TriangleInBox (const VEC3 &p1, const VEC3 &p2, const VEC3 &p3, const BOX &Box) |
Zwraca true, jeśli trójkąt zawiera się w prostopadłościanie. | |
bool | common::TriangleToBox (const VEC3 &TriA, const VEC3 &TriB, const VEC3 &TriC, const BOX &Box) |
Zwraca true, jeśli trójkąt przecina prostopadłościan lub się w nim zawiera. | |
bool | common::BoxToFrustum_Fast (const BOX &Box, const FRUSTUM_PLANES &Frustum) |
Zwraca true, jeśli podany prostopadłościan jest widoczny choć trochę w bryle widzenia. | |
bool | common::BoxToFrustum (const BOX &Box, const FRUSTUM_PLANES &FrustumPlanes, const FRUSTUM_POINTS *OptFrustumPoints=NULL) |
Zwraca true, jeśli podany prostopadłościan jest widoczny choć trochę w bryle widzenia. | |
bool | common::BoxToFrustum (const BOX &Box, const FRUSTUM_RADAR &Frustum) |
bool | common::BoxInFrustum (const BOX &Box, const FRUSTUM_PLANES &Frustum) |
Zwraca true, jeśli AABB jest w całości wewnątrz frustuma. | |
bool | common::SphereToSphere (const VEC3 &Center1, float Radius1, const VEC3 &Center2, float Radius2) |
Zwraca true jeśli podane dwie sfery kolidują ze sobą. | |
bool | common::SphereToPlane (const VEC3 &SphereCenter, float SphereRadius, const PLANE &Plane) |
Zwraca true, jeśli sfera koliduje z płaszczyzną. | |
int | common::ClassifySphereToPlane (const VEC3 &SphereCenter, float SphereRadius, const PLANE &Plane) |
Klasyfikuje położenie sfery względem płaszczyzny. | |
bool | common::CapsuleToPlane (const VEC3 &CapsuleBeg, const VEC3 &CapsuleEnd, float CapsuleRadius, const PLANE &Plane) |
Kolizja kapsuły (lub sfery poruszającej się od CapsuleBeg do CapsuleEnd) z płaszczyzną. | |
bool | common::SphereToFrustum_Fast (const VEC3 &SphereCenter, float SphereRadius, const FRUSTUM_PLANES &Frustum) |
Zwraca true, jeśli sfera koliduje z frustumem. | |
bool | common::SphereToFrustum (const VEC3 &SphereCenter, float SphereRadius, const FRUSTUM_PLANES &FrustumPlanes, const FRUSTUM_POINTS *OptFrustumPoints=NULL) |
Zwraca true, jeśli sfera koliduje z frustumem. | |
bool | common::SphereToFrustum (const VEC3 &SphereCenter, float SphereRadius, const FRUSTUM_RADAR &Frustum) |
Testuje przecięcie sfery z frustumem. | |
bool | common::SphereInFrustum (const VEC3 &SphereCenter, float SphereRadius, const FRUSTUM_PLANES &Frustum) |
Zwraca true, jeśli sfera zawiera się w całości wewnątrz frustuma. | |
bool | common::Intersect2Planes (const PLANE &Plane1, const PLANE &Plane2, VEC3 *OutLineOrig, VEC3 *OutLineDir) |
Wylicza kolizję dwóch płaszczyzn zwracając parametry prostej tworzącej ich przecięcie. | |
bool | common::Intersect3Planes (const PLANE &P1, const PLANE &P2, const PLANE &P3, VEC3 *OutP) |
Zwraca punkt przecięcia trzech płaszczyzn lub false, jeśli taki punkt nie istnieje. | |
bool | common::PlaneToTriangle (const PLANE &Plane, const VEC3 &p0, const VEC3 &p1, const VEC3 &p2) |
Kolizja płaszczyzny z trójkątem. | |
int | common::ClassifyPlaneToTriangle (const PLANE &Plane, const VEC3 &p0, const VEC3 &p1, const VEC3 &p2) |
Klasyfikuje położenie trójkąta względem płaszczyzny. | |
int | common::ClassifyFrustumToPlane (const FRUSTUM_POINTS &Frustum, const PLANE &Plane) |
Kolizja płaszczyzny z frustumem (klasyfikacja). | |
bool | common::SegmentToSegment (const VEC2 &Seg1_Beg, const VEC2 &Seg1_End, const VEC2 &Seg2_Beg, const VEC2 &Seg2_End, float *OutSeg1_t=NULL) |
Zwraca true, jeśli dwa odcinki 2D zachodzą na siebie. | |
bool | common::TriangleToTriangle (const VEC3 &V0, const VEC3 &V1, const VEC3 &V2, const VEC3 &U0, const VEC3 &U1, const VEC3 &U2) |
Testuje kolizję dwóch trójkątów 3D. | |
bool | common::TriangleInFrustum (const VEC3 &t1, const VEC3 &t2, const VEC3 &t3, const FRUSTUM_PLANES &Frustum) |
Testuje, czy trójkąt leży w całości wewnątrz frustuma. | |
bool | common::TriangleToFrustum (const VEC3 &t1, const VEC3 &t2, const VEC3 &t3, const PLANE *OptTrianglePlane, const FRUSTUM_PLANES &FrustumPlanes, const FRUSTUM_POINTS *OptFrustumPoints) |
Testuje kolizję trójkąta z frustumem. | |
bool | common::FrustumToFrustum (const FRUSTUM_PLANES &Frustum1_Planes, const FRUSTUM_POINTS &Frustum1_Points, const FRUSTUM_PLANES &Frustum2_Planes, const FRUSTUM_POINTS &Frustum2_Points) |
Testuje kolizję między dwoma frustumami. | |
bool | common::SphereToCapsule (const VEC3 &SphereCenter, float SphereRadius, const VEC3 &Capsule_Beg, const VEC3 &Capsule_End, float Capsule_Radius) |
Kolizja sfery z kapsułą. | |
bool | common::CapsuleToCapsule (const VEC3 &Capsule1_Beg, const VEC3 &Capsule1_End, float Capsule1_Radius, const VEC3 &Capsule2_Beg, const VEC3 &Capsule2_End, float Capsule2_Radius) |
Kolizja kapsuły z kapsułą. | |
bool | common::PointInConvexPolygon (const VEC2 &Point, const VEC2 PolygonPoints[], size_t PolygonPointCount) |
Sprawdza, czy punkt leży wewnątrz wypukłego wielokąta 2D. | |
bool | common::PointInConvexPolygon (const VEC2 &Point, const void *PolygonPoints, size_t PolygonPointCount, int PolygonPointStride) |
bool | common::PointInPolygon (const VEC2 &Point, const VEC2 PolygonPoints[], size_t PolygonPointCount) |
Zwraca true, jeśli podany punkt leży wewnątrz podanego wielokąta (2D). | |
bool | common::PointInPolygon (const VEC2 &Point, const void *PolygonPoints, size_t PolygonPointCount, int PolygonPointStride) |
bool | common::RayToConvexPolygon (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 PolygonPoints[], size_t PolygonPointCount, bool BackfaceCulling, float *OutT, VEC3 *OutPoint, const PLANE *PolygonPlane=NULL) |
Zwraca true, jeśli promień przecina wielokąt wypukły 3D i wtedy przez OutT zwraca parametr dla promienia. | |
bool | common::RayToConvexPolygon (const VEC3 &RayOrig, const VEC3 &RayDir, const void *PolygonPoints, size_t PolygonPointCount, int PolygonPointStride, bool BackfaceCulling, float *OutT, VEC3 *OutPoint, const PLANE *PolygonPlane=NULL) |
bool | common::RayToPolygon (const VEC3 &RayOrig, const VEC3 &RayDir, const VEC3 PolygonPoints[], size_t PolygonPointCount, bool BackfaceCulling, float *OutT, VEC3 *OutPoint, const PLANE *PolygonPlane=NULL) |
Zwraca true, jeśli promień przecina wielokąt 3D i wtedy przez OutT zwraca parametr dla promienia. | |
bool | common::RayToPolygon (const VEC3 &RayOrig, const VEC3 &RayDir, const void *PolygonPoints, size_t PolygonPointCount, int PolygonPointStride, bool BackfaceCulling, float *OutT, VEC3 *OutPoint, const PLANE *PolygonPlane=NULL) |
bool | common::SweptSphereToPlane (const VEC3 &SphereCenter, float SphereRadius, const VEC3 &SphereSweepDir, const PLANE &Plane, float *OutT0, float *OutT1) |
Liczy kolizję poruszającej się sfery z płaszczyzną. | |
bool | common::SweptSphereToFrustum (const VEC3 &SphereCenter, float SphereRadius, const VEC3 &SphereSweepDir, const FRUSTUM_PLANES &Frustum) |
Oblicza kolizję poruszającej się sfery z frustumem. | |
bool | common::SweptSphereToSphere (const VEC3 &SphereCenter1, float SphereRadius1, const VEC3 &SphereCenter2, float SphereRadius2, const VEC3 &SphereSweepDir1, float *OutT1, float *OutT2) |
Analityczna kolizja dwóch poruszających się sfer. | |
bool | common::SweptBoxToBox (const BOX &Box1, const BOX &Box2, const VEC3 &SweepDirBox1, float *OutT1, float *OutT2) |
Kolizja poruszającego się AABB z drugim AABB. | |
int | common::RayToCone (const VEC3 &rayOrig, const VEC3 &rayDir, const VEC3 &coneVertex, const VEC3 &coneDirVec, float coneHalfAngle, VEC3 intersections[2]) |
bool | common::PointInCone (const VEC3 &pt, const VEC3 &coneVertex, const VEC3 &coneDirVec, float coneHalfAngle) |
bool | common::SegmentIntersectsOrIsContainedInCone (const VEC3 &segmentPoint1, const VEC3 &segmentPoint2, const VEC3 &coneVertex, const VEC3 &coneDirVec, const float coneHalfAngle, VEC3 intersections[2], int &numIntersectionsFound) |
bool | common::SegmentIntersectsOrIsContainedInCone (const VEC3 &segmentPoint1, const VEC3 &segmentPoint2, const VEC3 &coneVertex, const VEC3 &coneDirVec, const float coneHalfAngle) |
size_t | common::ClosestPoint (const VEC2 &p, const VEC2 Points[], size_t PointCount, float *OutDistance=NULL) |
Z podanej tablicy punktów typu VEC2 znajduje punkt najbliższy względem p, zwraca jego indeks. | |
size_t | common::ClosestPoint (const VEC2 &p, const void *Data, size_t PointCount, int Stride, float *OutDistance=NULL) |
size_t | common::ClosestPoint (const VEC3 &p, const VEC3 Points[], size_t PointCount, float *OutDistance=NULL) |
Z podanej tablicy punktów typu VEC3 znajduje punkt najbliższy względem p, zwraca jego indeks. | |
size_t | common::ClosestPoint (const VEC3 &p, const void *Data, size_t PointCount, int Stride, float *OutDistance=NULL) |
size_t | common::FurthestPoint (const VEC2 &p, const VEC2 Points[], size_t PointCount, float *OutDistance=NULL) |
Z podanej tablicy punktów typu VEC2 znajduje punkt najdalszy względem p, zwraca jego indeks. | |
size_t | common::FurthestPoint (const VEC2 &p, const void *Data, size_t PointCount, int Stride, float *OutDistance=NULL) |
size_t | common::FurthestPoint (const VEC3 &p, const VEC3 Points[], size_t PointCount, float *OutDistance=NULL) |
Z podanej tablicy punktów typu VEC3 znajduje punkt najdalszy względem p, zwraca jego indeks. | |
size_t | common::FurthestPoint (const VEC3 &p, const void *Data, size_t PointCount, int Stride, float *OutDistance=NULL) |
size_t | common::FurthestPointForDir (const VEC2 &Dir, const VEC2 Points[], size_t PointCount) |
Z podanej tablicy punktów typu VEC2 znajduje najbardziej wysunięty w kierunku określonym przez Dir. Zwraca jego indeks. | |
size_t | common::FurthestPointForDir (const VEC2 &Dir, const void *Data, size_t PointCount, int Stride) |
size_t | common::FurthestPointForDir (const VEC3 &Dir, const VEC3 Points[], size_t PointCount) |
Z podanej tablicy punktów typu VEC3 znajduje najbardziej wysunięty w kierunku określonym przez Dir. Zwraca jego indeks. | |
size_t | common::FurthestPointForDir (const VEC3 &Dir, const void *Data, size_t PointCount, int Stride) |
void | common::RectBoundingPoints (RECTF *OutRect, const VEC2 Points[], size_t PointCount) |
Tworzy najmniejszy prostokąt otaczający podany zbiór punktów typu VEC2. | |
void | common::RectBoundingPoints (RECTF *OutRect, const void *Data, size_t PointCount, int Stride) |
void | common::BoxBoundingPoints (BOX *box, const VEC3 points[], size_t PointCount) |
Tworzy najmniejszy boks otaczający podany zbiór punktów typu VEC3. | |
void | common::BoxBoundingPoints (BOX *box, const void *Data, size_t PointCount, int Stride) |
void | common::SphereBoundingSpheres (VEC3 *OutCenter, float *OutRadius, const VEC3 &Center1, float Radius1, const VEC3 &Center2, float Radius2) |
Liczy sferę otaczającą dwie sfery. | |
void | common::CircleBoundingPoints (VEC2 *OutSphereCenter, float *OutSphereRadius, const VEC2 Points[], size_t PointCount) |
Znajduje okrąg otaczający podany zbiór punktów typu VEC2. | |
void | common::CircleBoundingPoints (VEC2 *OutSphereCenter, float *OutSphereRadius, const void *PointData, size_t PointCount, int PointStride) |
void | common::SphereBoundingPoints (VEC3 *OutSphereCenter, float *OutSphereRadius, const VEC3 Points[], size_t PointCount) |
Znajduje sferę otaczającą podany zbiór punktów typu VEC3. | |
void | common::SphereBoundingPoints (VEC3 *OutSphereCenter, float *OutSphereRadius, const void *PointData, size_t PointCount, int PointStride) |
void | common::OriginCircleBoundingPoints (float *OutRadius, const VEC2 Points[], size_t PointCount) |
Znajduje promień najmniejszego okręgu o środku (0,0) otaczającego podany zbiór punktów 2D. | |
void | common::OriginCircleBoundingPoints (float *OutRadius, const void *PointData, size_t PointCount, int PointStride) |
void | common::OriginSphereBoundingPoints (float *OutRadius, const VEC3 Points[], size_t PointCount) |
Znajduje promień najmniejszej sfery o środku (0,0) otaczającej podany zbiór punktów 3D. | |
void | common::OriginSphereBoundingPoints (float *OutRadius, const void *PointData, size_t PointCount, int PointStride) |
void | common::CalcCentroid (VEC2 *OutCentroid, const VEC2 Points[], size_t PointCount) |
Dla podanego zbioru punktów typu VEC2 oblicza ich centroid, czyli po prostu średnią. | |
void | common::CalcCentroid (VEC2 *OutCentroid, const void *PointData, size_t PointCount, int PointStride) |
void | common::CalcCentroid (VEC3 *OutCentroid, const VEC3 Points[], size_t PointCount) |
Dla podanego zbioru punktów typu VEC3 oblicza ich centroid, czyli po prostu średnią. | |
void | common::CalcCentroid (VEC3 *OutCentroid, const void *PointData, size_t PointCount, int PointStride) |
void | common::CalcCovarianceMatrix (MATRIX33 *OutCov, const VEC3 Points[], size_t PointCount) |
Oblicza macierz kowariancji dla podanego zbioru punktów typu VEC3. | |
void | common::CalcCovarianceMatrix (MATRIX33 *OutCov, const void *PointData, size_t PointCount, int PointStride) |
void | common::CalcEigenvaluesAndEigenvectors (MATRIX33 *InCovOutEigenvalues, MATRIX33 *OutEigenvectors) |
Oblicza wartości własne i wektory własne dla podanej macierzy symetrycznej (np. macierz kowariancji). | |
void | common::BoxBoundingSphere (VEC3 *SphereCenter, float *SphereRadius, const BOX &Box) |
Oblicza sferę otaczającą box. | |
void | common::SphereBoundingBox (BOX *Out, const VEC3 &SphereCenter, float SphereRadius) |
Oblicza box otaczający sferę. | |
void | common::BoxBoundingSpheres (BOX *OutBox, const VEC3 SpheresCenter[], const float SpheresRadius[], size_t SphereCount) |
Wylicza AABB otaczający podany zbiór sfer. | |
void | common::RandomPointInUnitSphere (VEC3 *Out, RandomGenerator &Rand) |
Losuje punkt wewnątrz kuli o środku w (0,0,0) i promieniu 1. Rozkład równomierny. | |
void | common::RandomPointInUnitSphere (VEC3 *Out) |
void | common::RandomPointInUnitCircle (VEC2 *Out, RandomGenerator &Rand) |
Losuje punkt wewnątrz koła o środku w (0,0) i promieniu 1. Rozkład równomierny. | |
void | common::RandomPointInUnitCircle (VEC2 *Out) |
void | common::CalcBillboardOrientation (VEC3 *OutRight, VEC3 *OutUp, unsigned DegreesOfFreedom, bool UseRealDir, const VEC3 &DefinedRight, const VEC3 &DefinedUp, const VEC3 &CamRightDir, const VEC3 &CamRealUpDir, const VEC3 &CameraToObjectDir) |
Calculates orientation of a 3D billboard in according to its parameters and camera parameters. | |
Variables | |
const float | common::FLOAT_EPSILON = 1e-6f |
Mała stała. | |
const common::POINT_ | common::POINT_ZERO |
const common::POINT_ | common::POINT_ONE |
const common::POINT_ | common::POINT_NEGATIVE_X |
const common::POINT_ | common::POINT_NEGATIVE_Y |
const common::POINT_ | common::POINT_POSITIVE_X |
const common::POINT_ | common::POINT_POSITIVE_Y |
const VEC2 | common::VEC2_ZERO |
const VEC2 | common::VEC2_ONE |
const VEC2 | common::VEC2_POSITIVE_X |
const VEC2 | common::VEC2_POSITIVE_Y |
const VEC2 | common::VEC2_NEGATIVE_X |
const VEC2 | common::VEC2_NEGATIVE_Y |
const VEC3 | common::VEC3_ZERO |
const VEC3 | common::VEC3_ONE |
const VEC3 | common::VEC3_POSITIVE_X |
const VEC3 | common::VEC3_POSITIVE_Y |
const VEC3 | common::VEC3_POSITIVE_Z |
const VEC3 | common::VEC3_NEGATIVE_X |
const VEC3 | common::VEC3_NEGATIVE_Y |
const VEC3 | common::VEC3_NEGATIVE_Z |
const VEC4 | common::VEC4_ZERO |
const VEC4 | common::VEC4_ONE |
const VEC4 | common::VEC4_POSITIVE_X |
const VEC4 | common::VEC4_POSITIVE_Y |
const VEC4 | common::VEC4_POSITIVE_Z |
const VEC4 | common::VEC4_POSITIVE_W |
const VEC4 | common::VEC4_NEGATIVE_X |
const VEC4 | common::VEC4_NEGATIVE_Y |
const VEC4 | common::VEC4_NEGATIVE_Z |
const VEC4 | common::VEC4_NEGATIVE_W |
const RECTI | common::RECTI_ZERO |
const RECTI | common::RECTI_ZERO_ONE |
const RECTI | common::RECTI_MINUS_ONE_ONE |
const RECTI | common::RECTI_MAX |
const RECTI | common::RECTI_INV_MAX |
const RECTF | common::RECTF_ZERO |
const RECTF | common::RECTF_ZERO_ONE |
const RECTF | common::RECTF_MINUS_ONE_ONE |
const RECTF | common::RECTF_MAX |
Maximal possible rectangle: -FLT_MAX..FLT_MAX. | |
const RECTF | common::RECTF_INV_MAX |
Inverted maximal rectangle: FLT_MAX..-FLT_MAX. It's invalid. Use it to initialize rectangle for finding min-max. | |
const BOX | common::BOX_ZERO |
const BOX | common::BOX_ZERO_ONE |
const BOX | common::BOX_MINUS_ONE_ONE |
const BOX | common::BOX_MAX |
Maximal possible box: -FLT_MAX..FLT_MAX. | |
const BOX | common::BOX_INV_MAX |
Inverted maximal box: FLT_MAX..-FLT_MAX. It's invalid. Use it to initialize box for finding min-max. | |
const COLOR | common::COLOR_TRANSPARENT_ |
const COLOR | common::COLOR_BLACK |
const COLOR | common::COLOR_GRAY |
const COLOR | common::COLOR_SILVER |
const COLOR | common::COLOR_WHITE |
const COLOR | common::COLOR_FUCHSIA |
const COLOR | common::COLOR_RED |
const COLOR | common::COLOR_ORANGE |
const COLOR | common::COLOR_YELLOW |
const COLOR | common::COLOR_LIME |
const COLOR | common::COLOR_AQUA |
const COLOR | common::COLOR_BLUE |
const COLOR | common::COLOR_PURPLE |
const COLOR | common::COLOR_MAROON |
const COLOR | common::COLOR_OLIVE |
const COLOR | common::COLOR_GREEN |
const COLOR | common::COLOR_TEAL |
const COLORF | common::COLORF_TRANSPARENT_ |
const COLORF | common::COLORF_BLACK |
const COLORF | common::COLORF_GRAY |
const COLORF | common::COLORF_SILVER |
const COLORF | common::COLORF_WHITE |
const COLORF | common::COLORF_FUCHSIA |
const COLORF | common::COLORF_RED |
const COLORF | common::COLORF_ORANGE |
const COLORF | common::COLORF_YELLOW |
const COLORF | common::COLORF_LIME |
const COLORF | common::COLORF_AQUA |
const COLORF | common::COLORF_BLUE |
const COLORF | common::COLORF_PURPLE |
const COLORF | common::COLORF_MAROON |
const COLORF | common::COLORF_OLIVE |
const COLORF | common::COLORF_GREEN |
const COLORF | common::COLORF_TEAL |
const PLANE | common::PLANE_ZERO |
const PLANE | common::PLANE_POSITIVE_X |
Płaszczyzna pionowa, równoległa do Y i Z, wskazująca na prawo na X. | |
const PLANE | common::PLANE_POSITIVE_Y |
Płaszczyzna pozioma, równoległa do X i Z, wskazująca do góry na Y. | |
const PLANE | common::PLANE_POSITIVE_Z |
Płaszczyzna pionowa, równoległa do X i Y, wskazująca w głąb na Z. | |
const PLANE | common::PLANE_NEGATIVE_X |
Płaszczyzna pionowa, równoległa do Y i Z, wskazująca na lewo na X. | |
const PLANE | common::PLANE_NEGATIVE_Y |
Płaszczyzna pozioma, równoległa do X i Z, wskazująca w dół na Y. | |
const PLANE | common::PLANE_NEGATIVE_Z |
Płaszczyzna pionowa, równoległa do X i Y, wskazująca do gracza na Z. | |
const LINE2D | common::LINE2D_ZERO |
const LINE2D | common::LINE2D_POSITIVE_X |
const LINE2D | common::LINE2D_NEGATIVE_X |
const LINE2D | common::LINE2D_POSITIVE_Y |
const LINE2D | common::LINE2D_NEGATIVE_Y |
const MATRIX | common::MATRIX_ZERO |
const MATRIX | common::MATRIX_IDENTITY |
const MATRIX33 | common::MATRIX33_ZERO |
const MATRIX33 | common::MATRIX33_IDENTITY |
const QUATERNION | common::QUATERNION_ZERO |
const QUATERNION | common::QUATERNION_IDENTITY |
const AFFINE2D | common::AFFINE2D_ZERO |
const AFFINE2D | common::AFFINE2D_IDENTITY |
const MATRIX | common::HL2_TO_TANGENT_MATRIX |
const MATRIX | common::TANGENT_TO_HL2_MATRIX |
const VEC3 | common::HL2_BASIS_VECTORS [3] |
Wektory bazowe HL2 Space wyrażone w Tangent Space. | |
const float | common::POISSON_DISC_1D [] |
const uint4 | common::POISSON_DISC_1D_COUNT = 100 |
const VEC2 | common::POISSON_DISC_2D [] |
const uint4 | common::POISSON_DISC_2D_COUNT = 100 |
const VEC3 | common::POISSON_DISC_3D [] |
const uint4 | common::POISSON_DISC_3D_COUNT = 100 |
Mathematical module.
Część biblioteki CommonLib
Kodowanie Windows-1250, koniec wiersza CR+LF, test: Zażółć gęślą jaźń
Licencja: GNU LGPL.
Dokumentacja: Module_Math
Elementy modułu: Math Module