{ -*- buffer-read-only: t -*-

  Copyright 2015-2018 Michalis Kamburelis.

  This file is part of "Castle Game Engine".

  "Castle Game Engine" is free software; see the file COPYING.txt,
  included in this distribution, for details about the copyright.

  "Castle Game Engine" is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  ----------------------------------------------------------------------------
}

{ Automatically generated node properties.

  Do not edit this file manually!
  To add new properties:
  - add them to the text files in nodes_specification/components/ ,
  - and regenerate include files by running
    nodes_specification/x3d-nodes-to-pascal/x3d-nodes-to-pascal.lpr .

  The documentation for properties should go to x3dnodes_documentation.txt . }

{$ifdef read_interface}

  strict private
    function GetCreateParticles: boolean;
    procedure SetCreateParticles(const Value: boolean);
    function GetEnabled: boolean;
    procedure SetEnabled(const Value: boolean);
    function GetLifetimeVariation: Single;
    procedure SetLifetimeVariation(const Value: Single);
    function GetMaxParticles: Integer;
    procedure SetMaxParticles(const Value: Integer);
    function GetParticleLifetime: Single;
    procedure SetParticleLifetime(const Value: Single);
    function GetParticleSize: TVector2;
    procedure SetParticleSize(const Value: TVector2);
    function GetColorRamp: TAbstractColorNode;
    procedure SetColorRamp(const Value: TAbstractColorNode);
    function GetEmitter: TAbstractParticleEmitterNode;
    procedure SetEmitter(const Value: TAbstractParticleEmitterNode);
    function GetTexCoordRamp: TTextureCoordinateNode;
    procedure SetTexCoordRamp(const Value: TTextureCoordinateNode);
  public
    property CreateParticles: boolean read GetCreateParticles write SetCreateParticles;
    property Enabled: boolean read GetEnabled write SetEnabled;
    property LifetimeVariation: Single read GetLifetimeVariation write SetLifetimeVariation;
    property MaxParticles: Integer read GetMaxParticles write SetMaxParticles;
    property ParticleLifetime: Single read GetParticleLifetime write SetParticleLifetime;
    property ParticleSize: TVector2 read GetParticleSize write SetParticleSize;
    property ColorRamp: TAbstractColorNode read GetColorRamp write SetColorRamp;
    procedure SetColorKey(const Value: array of Single);
    procedure SetColorKey(const Value: TSingleList);
    property Emitter: TAbstractParticleEmitterNode read GetEmitter write SetEmitter;
    procedure SetPhysics(const Value: array of TAbstractParticlePhysicsModelNode);
    property TexCoordRamp: TTextureCoordinateNode read GetTexCoordRamp write SetTexCoordRamp;
    procedure SetTexCoordKey(const Value: array of Single);
    procedure SetTexCoordKey(const Value: TSingleList);

{$endif read_interface}

{$ifdef read_implementation}

{ TParticleSystemNode ----------------------------------------------- }

function TParticleSystemNode.GetCreateParticles: boolean;
begin
  Result := FdCreateParticles.Value;
end;

procedure TParticleSystemNode.SetCreateParticles(const Value: boolean);
begin
  FdCreateParticles.Send(Value);
end;

function TParticleSystemNode.GetEnabled: boolean;
begin
  Result := FdEnabled.Value;
end;

procedure TParticleSystemNode.SetEnabled(const Value: boolean);
begin
  FdEnabled.Send(Value);
end;

function TParticleSystemNode.GetLifetimeVariation: Single;
begin
  Result := FdLifetimeVariation.Value;
end;

procedure TParticleSystemNode.SetLifetimeVariation(const Value: Single);
begin
  FdLifetimeVariation.Send(Value);
end;

function TParticleSystemNode.GetMaxParticles: Integer;
begin
  Result := FdMaxParticles.Value;
end;

procedure TParticleSystemNode.SetMaxParticles(const Value: Integer);
begin
  FdMaxParticles.Send(Value);
end;

function TParticleSystemNode.GetParticleLifetime: Single;
begin
  Result := FdParticleLifetime.Value;
end;

procedure TParticleSystemNode.SetParticleLifetime(const Value: Single);
begin
  FdParticleLifetime.Send(Value);
end;

function TParticleSystemNode.GetParticleSize: TVector2;
begin
  Result := FdParticleSize.Value;
end;

procedure TParticleSystemNode.SetParticleSize(const Value: TVector2);
begin
  FdParticleSize.Send(Value);
end;

function TParticleSystemNode.GetColorRamp: TAbstractColorNode;
begin
  if FdColorRamp.Value is TAbstractColorNode then
    Result := TAbstractColorNode(FdColorRamp.Value)
  else
    Result := nil;
end;

procedure TParticleSystemNode.SetColorRamp(const Value: TAbstractColorNode);
begin
  FdColorRamp.Send(Value);
end;

procedure TParticleSystemNode.SetColorKey(const Value: array of Single);
begin
  FdColorKey.Send(Value);
end;

procedure TParticleSystemNode.SetColorKey(const Value: TSingleList);
begin
  FdColorKey.Send(Value);
end;

function TParticleSystemNode.GetEmitter: TAbstractParticleEmitterNode;
begin
  if FdEmitter.Value is TAbstractParticleEmitterNode then
    Result := TAbstractParticleEmitterNode(FdEmitter.Value)
  else
    Result := nil;
end;

procedure TParticleSystemNode.SetEmitter(const Value: TAbstractParticleEmitterNode);
begin
  FdEmitter.Send(Value);
end;

procedure TParticleSystemNode.SetPhysics(const Value: array of TAbstractParticlePhysicsModelNode);
var
  L: Integer;
  A: array of TX3DNode;
begin
  L := High(Value) + 1;
  SetLength(A, L);
  if L > 0 then
    Move(Value[0], A[0], L * SizeOf(TAbstractParticlePhysicsModelNode));
  FdPhysics.Send(A);
end;

function TParticleSystemNode.GetTexCoordRamp: TTextureCoordinateNode;
begin
  if FdTexCoordRamp.Value is TTextureCoordinateNode then
    Result := TTextureCoordinateNode(FdTexCoordRamp.Value)
  else
    Result := nil;
end;

procedure TParticleSystemNode.SetTexCoordRamp(const Value: TTextureCoordinateNode);
begin
  FdTexCoordRamp.Send(Value);
end;

procedure TParticleSystemNode.SetTexCoordKey(const Value: array of Single);
begin
  FdTexCoordKey.Send(Value);
end;

procedure TParticleSystemNode.SetTexCoordKey(const Value: TSingleList);
begin
  FdTexCoordKey.Send(Value);
end;

{$endif read_implementation}
