#include <ps_plane_basis_maker.h>
Public Member Functions | |
| CSpinnerFunctor () | |
| ============================================================================ | |
| const NLMISC::CVector | getAxis (void) const |
| get the rotation axis | |
| const uint32 | getNumSamples (void) const |
| ============================================================================ | |
| const CPlaneBasis & | operator() (float date) const |
| void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| ============================================================================ | |
| void | setAxis (const NLMISC::CVector &axis) |
| ============================================================================ | |
| const void | setNumSamples (uint32 nbSamples) |
| ============================================================================ | |
Protected Member Functions | |
| void | updateSamples (void) |
| ============================================================================ | |
Protected Attributes | |
| NLMISC::CVector | _Axis |
| uint32 | _NbSamples |
| CPSVector< CPlaneBasis >::V | _PBTab |
|
|
============================================================================
Definition at line 297 of file ps_plane_basis_maker.cpp.
00297 : _NbSamples(0), _Axis(NLMISC::CVector::K) 00298 { 00299 } |
|
|
get the rotation axis
Definition at line 195 of file ps_plane_basis_maker.h.
00195 { return _Axis;}
|
|
|
============================================================================
Definition at line 317 of file ps_plane_basis_maker.cpp. References _NbSamples, and uint32.
00318 {
00319 return _NbSamples;
00320 }
|
|
|
Definition at line 191 of file ps_plane_basis_maker.h. References NLMISC::OptFastFloor().
00191 { return _PBTab[NLMISC::OptFastFloor(date * _NbSamples)]; }
|
|
|
============================================================================
Definition at line 323 of file ps_plane_basis_maker.cpp.
00324 {
00325 f.serialVersion(1);
00326 f.serial(_Axis, _NbSamples);
00327 if (f.isReading()) updateSamples();
00328 }
|
|
|
============================================================================
Definition at line 302 of file ps_plane_basis_maker.cpp. References _Axis, and updateSamples().
00303 {
00304 _Axis = axis;
00305 updateSamples();
00306 }
|
|
|
============================================================================
Definition at line 309 of file ps_plane_basis_maker.cpp. References _NbSamples, nlassert, uint32, and updateSamples().
00310 {
00311 nlassert(nbSamples > 0);
00312 _NbSamples = nbSamples;
00313 updateSamples();
00314 }
|
|
|
============================================================================
Definition at line 331 of file ps_plane_basis_maker.cpp. References _Axis, _NbSamples, _PBTab, NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), uint32, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z. Referenced by setAxis(), and setNumSamples().
00332 {
00333 if (_NbSamples == 0) return;
00334 // compute step between each angle
00335 const float angInc = (float) (2.f * NLMISC::Pi / _NbSamples);
00336 _PBTab.resize(_NbSamples + 1);
00337 NLMISC::CMatrix mat;
00338 CPSUtil::buildSchmidtBasis(_Axis, mat);
00339 NLMISC::CVector I = mat.getI();
00340 NLMISC::CVector J = mat.getJ();
00341 // compute basis for rotation
00342 for (uint32 k = 0; k < _NbSamples; ++k)
00343 {
00344 float ca = cosf(k * angInc);
00345 float sa = sinf(k * angInc);
00346 _PBTab[k].X.set(ca * I.x + sa * J.x,
00347 ca * I.y + sa * J.y,
00348 ca * I.z + sa * J.z);
00349
00350 _PBTab[k].Y.set(- sa * I.x + ca * J.x,
00351 - sa * I.y + ca * J.y,
00352 - sa * I.z + ca * J.z);
00353 }
00354 }
|
|
|
Definition at line 205 of file ps_plane_basis_maker.h. Referenced by setAxis(), and updateSamples(). |
|
|
Definition at line 204 of file ps_plane_basis_maker.h. Referenced by getNumSamples(), setNumSamples(), and updateSamples(). |
|
|
Definition at line 203 of file ps_plane_basis_maker.h. Referenced by updateSamples(). |
1.3.6