Unit1.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include <math.h>
  4. #pragma hdrstop
  5. #include "Unit1.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. #pragma link "GLS.GeomObjects"
  9. #pragma link "GLS.SceneViewer"
  10. #pragma link "GLS.Cadencer"
  11. #pragma link "GLS.VectorGeometry"
  12. #pragma link "GLS.Scene"
  13. #pragma link "GLS.Objects"
  14. #pragma link "GLS.BaseClasses"
  15. #pragma link "GLS.Coordinates"
  16. #pragma resource "*.dfm"
  17. TForm1 *Form1;
  18. //---------------------------------------------------------------------------
  19. __fastcall TForm1::TForm1(TComponent * Owner):TForm(Owner)
  20. {
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::GLCadencer1Progress(TObject * Sender,
  24. const double deltaTime,
  25. const double newTime)
  26. {
  27. // Make the blue sphere turn and ride a sin
  28. DCSphere->Turn(deltaTime * 30);
  29. Sphere->Position->Y = sin(DegToRad(newTime * 50)) * 3;
  30. // Make the arrow turn
  31. DCArrow->Turn(-deltaTime * 15);
  32. // Make the arrow point toward the sphere, using Y as up reference
  33. ArrowLine->PointTo(Sphere, YHmgVector);
  34. }
  35. //---------------------------------------------------------------------------