fOdeMachineC.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // ---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "fOdeMachineC.h"
  5. // ---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "GLS.BaseClasses"
  8. #pragma link "GLS.BitmapFont"
  9. #pragma link "GLS.Cadencer"
  10. #pragma link "GLS.Coordinates"
  11. #pragma link "GLS.GeomObjects"
  12. #pragma link "GLS.HUDObjects"
  13. #pragma link "GLS.Objects"
  14. #pragma link "Physics.ODEManager"
  15. #pragma link "GLS.Scene"
  16. #pragma link "GLS.SceneViewer"
  17. #pragma link "GLS.WindowsFont"
  18. #pragma resource "*.dfm"
  19. TForm1 *Form1;
  20. // ---------------------------------------------------------------------------
  21. __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {
  22. }
  23. // ---------------------------------------------------------------------------
  24. void __fastcall TForm1::GLSceneViewer1MouseDown(TObject *Sender,
  25. TMouseButton Button, TShiftState Shift, int X, int Y) {
  26. my = Y;
  27. mx = X;
  28. }
  29. // ---------------------------------------------------------------------------
  30. void __fastcall TForm1::GLSceneViewer1MouseMove(TObject *Sender,
  31. TShiftState Shift, int X, int Y) {
  32. if (Shift.Contains(ssShift))
  33. GLCamera1->MoveAroundTarget(my - Y, mx - X);
  34. my = Y;
  35. mx = X;
  36. }
  37. // ---------------------------------------------------------------------------
  38. void __fastcall TForm1::GLCadencer1Progress(TObject *Sender,
  39. const double deltaTime, const double newTime) {
  40. GLODEManager1->Step(deltaTime);
  41. /*
  42. PdVector3 velWheel = dBodyGetAngularVel(TGLODEDynamic(Wheel->Behaviours)->Body);
  43. PdVector3 velPin2 = dBodyGetLinearVel(TGLODEDynamic(Pin2->Behaviours[0])->Body);
  44. GLHUDText1->Text = Format(
  45. "Wheel Angular Velocity (Y-Axis) = %.1f\r\
  46. Pin2 Linear Velocity (X-Axis) = %.1f",
  47. ARRAYOFCONST((velWheel[1], velPin2[0])));
  48. */
  49. }
  50. // ---------------------------------------------------------------------------