fOctreeRenderC.h 2.6 KB

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