fInvarianceC.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "fInvarianceC.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "GLS.BaseClasses"
  8. #pragma link "GLS.Coordinates"
  9. #pragma link "GLS.GeomObjects"
  10. #pragma link "GLS.Material"
  11. #pragma link "GLS.Objects"
  12. #pragma link "GLS.Scene"
  13. #pragma link "GLS.SceneViewer"
  14. #pragma resource "*.dfm"
  15. TForm1 *Form1;
  16. //---------------------------------------------------------------------------
  17. __fastcall TForm1::TForm1(TComponent* Owner)
  18. : TForm(Owner)
  19. {
  20. }
  21. //---------------------------------------------------------------------------
  22. void __fastcall TForm1::FormCreate(TObject *Sender)
  23. {
  24. SetGLSceneMediaDir();
  25. }
  26. //---------------------------------------------------------------------------
  27. void __fastcall TForm1::GLSceneViewer1MouseMove(TObject *Sender, TShiftState Shift,
  28. int X, int Y)
  29. {
  30. if (Shift.Contains(ssLeft))
  31. GLCamera->MoveAroundTarget(my-Y, mx-X);
  32. if (Shift.Contains(ssRight))
  33. GLCamera->MoveTargetInEyeSpace((Y-my)*0.05, (mx-X)*0.05, 0);
  34. mx = X; my = Y;
  35. }
  36. //---------------------------------------------------------------------------
  37. void __fastcall TForm1::GLSceneViewer1MouseDown(TObject *Sender, TMouseButton Button,
  38. TShiftState Shift, int X, int Y)
  39. {
  40. mx = X; my = Y;
  41. }
  42. //---------------------------------------------------------------------------