fInvarianceC.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. TFileName Path = GetCurrentAssetPath();
  25. SetCurrentDir(Path + "\\texture");
  26. GLMaterialLibrary->TexturePaths = GetCurrentDir();
  27. }
  28. //---------------------------------------------------------------------------
  29. void __fastcall TForm1::GLSceneViewer1MouseMove(TObject *Sender, TShiftState Shift,
  30. int X, int Y)
  31. {
  32. if (Shift.Contains(ssLeft))
  33. GLCamera->MoveAroundTarget(my-Y, mx-X);
  34. if (Shift.Contains(ssRight))
  35. GLCamera->MoveTargetInEyeSpace((Y-my)*0.05, (mx-X)*0.05, 0);
  36. mx = X; my = Y;
  37. }
  38. //---------------------------------------------------------------------------
  39. void __fastcall TForm1::GLSceneViewer1MouseDown(TObject *Sender, TMouseButton Button,
  40. TShiftState Shift, int X, int Y)
  41. {
  42. mx = X; my = Y;
  43. }
  44. //---------------------------------------------------------------------------