unit ControlCenter;

interface   

uses
  _Geometry,
  Frost.Engine,
  Frost.GL,
  BaseBuild,
  _PNG;

type
TControlCenter = class(TBuild)
  private
    class var FMesh: TMesh;
    class var FMaterial: TMaterial;
  public
    procedure OnStart; override;
    procedure OnUpdate(const Delta: Double); override;
    procedure OnDestroy; override;
  end;

implementation

{$REGION 'Control Center'}
procedure TControlCenter.OnStart;
begin
  if FMesh = nil then
  begin
    FMesh := Resources.LoadMMSMesh('data/models/control_center.mms', 0.2).Translate(Vector3(4,10,0));
    FMaterial := TTexturedMaterial.Create(LoadPNGTexture('data/textures/control_center.png'));
  end;
  CreateMesh(FMesh, FMaterial, Vector3(2.0,2.0,1), 15);
end;
         
procedure TControlCenter.OnUpdate(const Delta: Double);
begin
  CheckBoundCollision();
  Animate(Delta);
end;

procedure TControlCenter.OnDestroy;
begin

end;
{$ENDREGION}

end.
