#include <bvolumes.h>
Public Member Functions | |
| BSphere () | |
| Class constructor. | |
| BSphere (const BSphere &s) | |
| Copy constructor. | |
| ~BSphere () | |
| Class destructor. | |
| bool | Intersects (const BSphere *s) const |
| BSphere-sphere intersection test. | |
| bool | Intersects (const BCone *K) const |
| BSphere-cone intersection test. | |
| BSphere & | operator= (const BSphere &s) |
| Prevent copying NULL pointers - when debugging. | |
| wxString | ToString () const |
| Get string with bounds. | |
Public Attributes | |
| VECTOR3 | Center |
| BSphere center. | |
| float | Radius |
| BSphere radius. | |
Definition at line 286 of file bvolumes.h.
| VRUT::BSphere::BSphere | ( | ) | [inline] |
| VRUT::BSphere::BSphere | ( | const BSphere & | s | ) | [inline] |
| VRUT::BSphere::~BSphere | ( | ) | [inline] |
| bool VRUT::BSphere::Intersects | ( | const BSphere * | s | ) | const [inline] |
| bool VRUT::BSphere::Intersects | ( | const BCone * | K | ) | const [inline] |
BSphere-cone intersection test.
Definition at line 311 of file bvolumes.h.
00312 { 00313 VECTOR3 U = K->Center - (Radius / sinf(K->Angle)) * K->Axis; 00314 VECTOR3 D = Center - U; 00315 float dsqr = D.Dot(D); 00316 float e = K->Axis.Dot(D); 00317 float cs = cosf(K->Angle); 00318 if ( e > 0 00319 && e * e >= dsqr * cs * cs ) 00320 { 00321 D = Center - K->Center; 00322 dsqr = D.Dot(D); 00323 e = -K->Axis.Dot(D); 00324 float sn = sinf(K->Angle); 00325 if ( e > 0 && e * e >= dsqr * sn * sn ) 00326 return dsqr <= Radius * Radius; 00327 else 00328 return true; 00329 } 00330 return false; 00331 }
| wxString VRUT::BSphere::ToString | ( | ) | const [inline] |
Get string with bounds.
Definition at line 342 of file bvolumes.h.
00343 { 00344 return wxString::Format(wxT("Center: %s\nRadius: %f\n"), Center.ToString().c_str(), Radius); 00345 }
| float VRUT::BSphere::Radius |
1.5.5