plane Struct Reference
Plane structure.
More...
#include <3dmath.h>
List of all members.
Detailed Description
Plane structure.
Definition at line 344 of file 3dmath.h.
Constructor & Destructor Documentation
plane::plane |
( |
float |
_a = 0 , |
|
|
float |
_b = 0 , |
|
|
float |
_c = 0 , |
|
|
float |
_d = 0 | |
|
) |
| | [inline] |
Constructor.
Definition at line 358 of file 3dmath.h.
00358 : a(_a), b(_b), c(_c), d(_d) {}
plane::plane |
( |
const plane & |
p |
) |
[inline] |
Copy constructor.
Definition at line 361 of file 3dmath.h.
00361 : a(p.a), b(p.b), c(p.c), d(p.d) {}
Member Function Documentation
plane& plane::operator= |
( |
const plane & |
p |
) |
[inline] |
Assignment operator.
Definition at line 364 of file 3dmath.h.
00365 {
00366 a = p.a;
00367 b = p.b;
00368 c = p.c;
00369 d = p.d;
00370 return *this;
00371 }
plane plane::Normalize |
( |
|
) |
const [inline] |
Get normalized plane.
Definition at line 374 of file 3dmath.h.
00375 {
00376 float imag = 1.0f / sqrtf(a*a + b*b + c*c);
00377 return plane(a * imag, b * imag, c * imag, d * imag);
00378 }
static plane plane::FromPointNorm |
( |
const vector3 & |
point, |
|
|
const vector3 & |
normal | |
|
) |
| | [inline, static] |
Get plane from point and normal.
Definition at line 381 of file 3dmath.h.
00382 {
00383 return plane(normal.x, normal.y, normal.z, -normal.Dot(point));
00384 }
float plane::DotCoord |
( |
const vector3 & |
p |
) |
const [inline] |
Get point distance from plane.
Definition at line 396 of file 3dmath.h.
00397 {
00398 return a * p.x + b * p.y + c * p.z + d;
00399 }
wxString plane::ToString |
( |
|
) |
const [inline] |
Get string.
Definition at line 402 of file 3dmath.h.
00403 {
00404 return wxString(wxT("(")) << a << wxT(", ") << b << wxT(", ") << c << wxT(", ") << d << wxT(")");
00405 }
plane* plane::Clone |
( |
|
) |
const [inline] |
Get copy of instance.
Definition at line 414 of file 3dmath.h.
00415 {
00416 return new plane(*this);
00417 }
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const plane & |
p | |
|
) |
| | [friend] |
Output stream operator.
Definition at line 408 of file 3dmath.h.
00409 {
00410 return os << "(" << p.a << ", " << p.b << ", " << p.c << ", " << p.d << ")";
00411 }
Member Data Documentation
The documentation for this struct was generated from the following file:
- /cygdrive/d/src/svn/vrut/trunk/core/src/3dmath.h