Rotator.as 521 B

12345678910111213141516
  1. // Rotator script object class. Script objects to be added to a scene node must implement the empty ScriptObject interface
  2. class Rotator : ScriptObject
  3. {
  4. Vector3 rotationSpeed;
  5. void SetRotationSpeed(const Vector3&in speed)
  6. {
  7. rotationSpeed = speed;
  8. }
  9. // Update is called during the variable timestep scene update
  10. void Update(float timeStep)
  11. {
  12. node.Rotate(Quaternion(rotationSpeed.x * timeStep, rotationSpeed.y * timeStep, rotationSpeed.z * timeStep));
  13. }
  14. }