Class TFBU_EffectManager

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TFBU_EffectManager = class(TObject)

Description

This is the main manager class. See the unit description for a detailed description of how it works.

See also
TFBU_Effect

Hierarchy

Overview

Fields

Protected FWind: TFB_Vectorf3;
Protected FEffects: Array of TFBU_Effect;
Protected FCamPosition: TFB_Vectorf3;
Protected FUpdateDelay: Single;
Protected FVertexStorage: Cardinal;
Protected FCount: Cardinal;
Protected FSizeIncrement: Cardinal;

Methods

Protected procedure Sort;
Protected procedure ResetCalcDelays;
Protected procedure OnEffectFinished(Sender: TObject);
Protected function FindItem(AItem: TFBU_Effect): Integer;
Public constructor Create;
Public procedure Add(AEffect: TFBU_Effect; AExcludeFromDelay: Boolean = false);
Public procedure Remove(AEffect: TFBU_Effect);
Public procedure RemoveAll;
Public procedure SendTermSignalToAll;
Public procedure SetWind(x, y, z: Single); overload;
Public procedure SetWind(ARef: Pointer); overload;
Public procedure SetVertexStorage(AVertexStorage: Cardinal);
Public procedure Update(AViewMat: Pointer; ADeltaTime: Single); overload;
Public procedure Update(ADeltaTime: Single); overload;
Public procedure Render(APrepareGL: Boolean = True);

Properties

Public property Wind: TFB_Vectorf3 read FWind;
Public property UpdateDelay: Single read FUpdateDelay write SetUpdateDelay;
Public property Count: Cardinal read FCount;
Public property AllocationIncrement: Cardinal read FSizeIncrement write FSizeIncrement;
Public property Item[Index: Integer]: TFBU_Effect read GetItem;

Description

Fields

Protected FWind: TFB_Vectorf3;

Assigned wind vector

Protected FEffects: Array of TFBU_Effect;

Array which stores the effects

Protected FCamPosition: TFB_Vectorf3;

The position of the camera

Protected FUpdateDelay: Single;

The delay after which the Update method of an effect shall be called

Protected FVertexStorage: Cardinal;

Storage Type

Protected FCount: Cardinal;

Effect Count

Protected FSizeIncrement: Cardinal;

Array size increment

Methods

Protected procedure Sort;

Sorts the array

Protected procedure ResetCalcDelays;

Resets all update delays

Protected procedure OnEffectFinished(Sender: TObject);

FEffectFinished callback method

Parameters
Sender
Contains the instance which called the method
Protected function FindItem(AItem: TFBU_Effect): Integer;

Searches an effect in the array

Parameters
AItem
The instance to search
Returns

The items index in the array (-1 if it hasn't been found)

Public constructor Create;

Class constructor

Parameters
AOwner
Owner component
Public procedure Add(AEffect: TFBU_Effect; AExcludeFromDelay: Boolean = false);

Adds an effect to the manager

Parameters
AEffect
The effect instance
AExcludeFromDelay
When true, the effect will be updated every frame.
Public procedure Remove(AEffect: TFBU_Effect);

Removes and frees the effect in the next update cycle

Parameters
AEffect
The effect instance
Public procedure RemoveAll;

Removes and frees all effects in the next update cycle

Public procedure SendTermSignalToAll;

Sends the terminate signal to all effects

See also
TFBU_Effect.Terminate
Public procedure SetWind(x, y, z: Single); overload;

Sets the wind vector for all registered effects.

Public procedure SetWind(ARef: Pointer); overload;

Sets the wind vector for all registered effects.

Public procedure SetVertexStorage(AVertexStorage: Cardinal);

Sets the vertex storage mode for FireBlade

Parameters
AVertexStorage
The vertex storage mode.
See also
FB_VERTEXSTORAGE_VA
FB_VERTEXSTORAGE_VBO
FB_VERTEXSTORAGE_USER
Public procedure Update(AViewMat: Pointer; ADeltaTime: Single); overload;

Updates the effects if they are over the UpdateDelay represent a 4x4 OpenGL modelview matrix.

Parameters
AViewMat
Pointer to a sequence of 16 float values with single precision, which
ADeltaTime
The time since the last call
Public procedure Update(ADeltaTime: Single); overload;

Convenience method. Uses the current modelview matrix of OpenGL for calculation.

Parameters
ADeltaTime
The time since the last call
Public procedure Render(APrepareGL: Boolean = True);

Renders all effects of OpenGL attributes to achieve texturing and blending

Parameters
APrepareGL
If True, FireBlade will do the necessary initialization

Properties

Public property Wind: TFB_Vectorf3 read FWind;

Sets the wind vector for all effects

Public property UpdateDelay: Single read FUpdateDelay write SetUpdateDelay;

Sets the update delay

Public property Count: Cardinal read FCount;

The current effect count

Public property AllocationIncrement: Cardinal read FSizeIncrement write FSizeIncrement;

Array size incrementprocedure TFBU_EffectManager.SetWind(Value: TFB_Vectorf3);

Public property Item[Index: Integer]: TFBU_Effect read GetItem;

Standard property - Effect with index Index in the manager


Generated by PasDoc 0.11.0 on 2009-06-29 23:12:34