Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CommandRotate Class Reference

#include <command.h>

Inheritance diagram for CommandRotate:

Inheritance graph
Collaboration diagram for CommandRotate:

Collaboration graph
List of all members.

Public Member Functions

 CommandRotate (double _duration, const Vec3f &axis, float rate)
void process (ExecutionEnvironment &, double t, double dt)

Private Attributes

Vec3f spin

Constructor & Destructor Documentation

CommandRotate::CommandRotate double  _duration,
const Vec3f axis,
float  rate
 

Definition at line 387 of file command.cpp.

00387                                                                             :
00388     TimedCommand(_duration),
00389     spin(axis * rate)
00390 {
00391 }


Member Function Documentation

void CommandRotate::process ExecutionEnvironment ,
double  t,
double  dt
[virtual]
 

Implements Command.

Definition at line 393 of file command.cpp.

References Vector3< T >::length(), Quaternion< T >::rotate(), Quaternion< T >::setAxisAngle(), and spin.

00394 {
00395     float v = spin.length();
00396     if (v != 0.0f)
00397     {
00398         Quatf q;
00399         q.setAxisAngle(spin / v, (float) (v * dt));
00400         env.getSimulation()->rotate(q);
00401     }
00402 }


Member Data Documentation

Vec3f CommandRotate::spin [private]
 

Definition at line 331 of file command.h.

Referenced by process().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:14 2006 for Celestia by  doxygen 1.4.1