Unit1.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //---------------------------------------------------------------------------
  2. #ifndef Unit1H
  3. #define Unit1H
  4. //---------------------------------------------------------------------------
  5. #include <vcl.h>
  6. #include "GLBaseClasses.hpp"
  7. #include "GLCadencer.hpp"
  8. #include "GLCoordinates.hpp"
  9. #include "GLCrossPlatform.hpp"
  10. #include "GLMaterial.hpp"
  11. #include "GLObjects.hpp"
  12. #include "GLScene.hpp"
  13. #include "GLSimpleNavigation.hpp"
  14. #include "GLWin32Viewer.hpp"
  15. #include <System.Classes.hpp>
  16. #include <Vcl.ComCtrls.hpp>
  17. #include <Vcl.Controls.hpp>
  18. #include <Vcl.ExtCtrls.hpp>
  19. #include <Vcl.StdCtrls.hpp>
  20. #include "GLSpacePartition.hpp"
  21. #include "GLContext.hpp"
  22. #include "GLVectorgeometry.hpp"
  23. #include "OpenGLTokens.hpp"
  24. //---------------------------------------------------------------------------
  25. class TForm1 : public TForm
  26. {
  27. __published: // IDE-managed Components
  28. TGLSceneViewer *GLSceneViewer1;
  29. TPanel *Panel1;
  30. TLabel *Label3;
  31. TLabel *Label2;
  32. TLabel *LabelCollisions;
  33. TTrackBar *TrackBar_LeafThreshold;
  34. TButton *Button_ResetOctreeSize;
  35. TGLScene *GLScene1;
  36. TGLDummyCube *GLDummyCube1;
  37. TGLDirectOpenGL *GLDirectOpenGL1;
  38. TGLCube *GLCube1;
  39. TGLSphere *GLSphere1;
  40. TGLPlane *GLPlane1;
  41. TGLLines *GLLines1;
  42. TGLCamera *GLCamera1;
  43. TGLLightSource *GLLightSource1;
  44. TGLCadencer *GLCadencer1;
  45. TGLSimpleNavigation *GLSimpleNavigation1;
  46. TGLMaterialLibrary *GLMaterialLibrary1;
  47. void __fastcall FormCreate(TObject *Sender);
  48. void __fastcall TrackBar_LeafThresholdChange(TObject *Sender);
  49. void __fastcall FormDestroy(TObject *Sender);
  50. void __fastcall Button_ResetOctreeSizeClick(TObject *Sender);
  51. void __fastcall GLCadencer1Progress(TObject *Sender, const double deltaTime, const double newTime);
  52. void __fastcall GLDirectOpenGL1Render(TObject *Sender, TGLRenderContextInfo &rci);
  53. private: // User declarations
  54. TOctreeSpacePartition *Octree;
  55. void __fastcall CreateBox();
  56. void __fastcall VerifySpacialMisc();
  57. void __fastcall RenderAABB(TAABB* AABB, float w, float r, float g, float b);
  58. void __fastcall RenderOctreeNode(TSectorNode* Node);
  59. public: // User declarations
  60. __fastcall TForm1(TComponent* Owner);
  61. };
  62. class TGLSpacePartitionLeaf : public TSpacePartitionLeaf
  63. {
  64. __published: // IDE-managed Components
  65. TGLBaseSceneObject *GLBaseSceneObject;
  66. void __fastcall UpdateCachedAABBAndBSphere(); //override;
  67. virtual __fastcall CreateGLOwned(TBaseSpacePartition *SpacePartition, TGLBaseSceneObject *aGLBaseSceneObject);
  68. private: // User declarations
  69. TAffineVector Direction;
  70. };
  71. //---------------------------------------------------------------------------
  72. extern PACKAGE TForm1 *Form1;
  73. //---------------------------------------------------------------------------
  74. #endif