| 1 |
NAME SoRotor SoRotor "" { animated rotation node } |
| 2 |
|
| 3 |
INCLUDE nodes/SoRotor.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
The \cSoRotor\. class is derived from \cSoRotation\., so it applies a |
| 7 |
rotation to the current transformation. Using engines connected to |
| 8 |
the \vrealTime\. global field, the rotation value is animated over |
| 9 |
time, achieving a spinning effect. The period of the rotation can be |
| 10 |
adjusted by changing the \vspeed\. field. |
| 11 |
\p |
| 12 |
The current rotation at any time is available in the \vrotation\. |
| 13 |
field, inherited from \cSoRotation\.. This field can also be set to |
| 14 |
specify the axis of rotation. Note that unless a non-zero rotation is |
| 15 |
specified for the rotation, the node will not know which axis to use. |
| 16 |
For example, to set a rotor to spin about the y-axis, use the |
| 17 |
following: |
| 18 |
\b\k |
| 19 |
\+rotor->rotation.setValue(axis, 0.1);\.\-SoSRotSetAxisAngle(&(rotor->rotation), &axis, 0.1);\. |
| 20 |
\.\. |
| 21 |
where \aaxis\. is a vector containing (0,1,0). Any non-zero angle can |
| 22 |
be used in this code. |
| 23 |
} |
| 24 |
|
| 25 |
FIELD speed { Defines the speed of the rotor, in revolutions per second. } |
| 26 |
|
| 27 |
FIELD on { Allows applications to enable or disable the motion easily. } |
| 28 |
|
| 29 |
METHOD "" SoRotor() { |
| 30 |
Creates a rotor node with default settings. |
| 31 |
} |
| 32 |
|
| 33 |
METHOD "" static SoType getClassTypeId() { |
| 34 |
Returns type identifier for this class. |
| 35 |
} |
| 36 |
|
| 37 |
ACTION SoGLRenderAction, SoCallbackAction, |
| 38 |
SoGetBoundingBoxAction, SoRayPickAction { |
| 39 |
Concatenates current rotation value with the current |
| 40 |
transformation matrix. |
| 41 |
} |
| 42 |
|
| 43 |
ACTION SoGetMatrixAction { |
| 44 |
Returns transformation matrix specified by the rotation. |
| 45 |
} |
| 46 |
|
| 47 |
ALSO { SoPendulum, SoShuttle } |