1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "GLS.BaseClasses"
- #pragma link "GLS.Cadencer"
- #pragma link "GLS.Coordinates"
- #pragma link "GLS.Extrusion"
- #pragma link "GLS.FireFX"
- #pragma link "GLS.GeomObjects"
- #pragma link "GLS.Objects"
- #pragma link "GLS.Scene"
- #pragma link "GLS.SceneViewer"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- int mx,my;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormResize(TObject *Sender)
- {
- GLCamera1->FocalLength = Height/3;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::GLSceneViewer1MouseDown(TObject *Sender, TMouseButton Button,
- TShiftState Shift, int X, int Y)
- {
- mx = X; my = Y;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::TrackBar1Change(TObject *Sender)
- {
- GLFireFXManager1->FireDir->Z = -TrackBar1->Position*0.1;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::GLSceneViewer1MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- if (Shift.Contains(ssLeft) || Shift.Contains(ssRight)) // if (Shift <> [])
- {
- GLCamera1->MoveAroundTarget(my-Y, mx-X);
- GLCadencer1->Progress();
- mx = X; my = Y;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Timer1Timer(TObject *Sender)
- {
- int n;
- Caption = "GLS.Scene Candles - "+ Format("%.1f FPS", ARRAYOFCONST((GLSceneViewer1->FramesPerSecond())));
- GLSceneViewer1->ResetPerformanceMonitor();
- if (TrackBar1->Position==0)
- GLFireFXManager1->Disabled = False;
- else {
- n = abs(TrackBar1->Position)-15;
- if (n>0)
- if (Random()/n<0.15) GLFireFXManager1->Disabled = True;
- }
- }
- //---------------------------------------------------------------------------
|